Har devgun Har devgun - 3 months ago 22
TypeScript Question

Angularjs 2.0 doesn't load templateUrl

I am new for

Angularjs-2.0
. I have created a sample application,and have an issue in loading
templateUrl
.

My app.ts file:

import {bootstrap, Component} from 'angular2/angular2';
@Component({
selector: 'my-app',
templateUrl: 'grid.html'
})
class AppComponent { }
bootstrap(AppComponent);


I change the path like
./grid.html
but it doesn't work for me too.

Someone help me..!

Joy Joy
Answer

If your directory structure is like this:

|- app
   |- grid.html
   |- component.ts
   myApp.ts

Then use templateUrl: 'app/grid.html'.