If your directory structure looks like this:
|- app
|- grid.html
|- component.ts
myApp.ts
Then use templateUrl: 'app/grid.html'.
Update
The above solution makes us hard code app/in every place to include these files. So here is another one:
- Define
"module": "commonjs"in filetsconfig.json - Add a new line
moduleId: module.id,to the decorator @Component.
So it will be:
@Component({
selector: 'my-app',
moduleId: module.id,
templateUrl: 'grid.html'
})
Link: