Just getting my feet wet with Angular 2. Got some things working, but I 
have a question about use of the *templateUrl *member in the *ViewAnnotation 
*class. Issue I have is that the component I am trying to load is not at 
the app root. It is off of the approot at *ui/app/AppA2Cmp.ts*. Here is a 
snippet of what I had:

import {Component, View, bootstrap, NgFor, CSSClass} from 'angular2/angular2';

@Component({
  selector: 'appa2'
})
@View({
  templateUrl: 'AppA2.html',
  directives: [NgFor, CSSClass]
})
class AppA2Cmp
{

  constructor()
  {
  }
}

bootstrap(AppA2Cmp);


Note that *AppA2.ts* and *AppA2.html* are in the same directory. But 
*AppA2.html* fails to load because Chrome tells me it was trying to load it 
from the app root. Is that right? I would have expected the A2 framework to 
load from where the *App2Cmp.ts* lives. 

It works if I change the templateUrl to be:

  templateUrl: 'ui/app/AppA2.html',


This implies that any time I refactor a component I would have to fix up 
the *templateUrl *refs to make them relative to the app root. Am I missing 
something?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to