Reputation: 1141
I am developing an Angular 2 application and now I am facing an unexpected .ts
file extension issue in all my local file includes.
See my code below
@Component({
selector: 'home',
template: require('./home.component.html')
})
Here I am getting error like
GET http://192.168.1.36/angular2/smd/app/home.component.html.ts 404 (Not Found)
How can I avoid the unwanted .ts
extension from my local files?
Please suggest me a solution
Thanks..
Upvotes: 0
Views: 56
Reputation: 23506
In your component annotation you only need to set the templateUrl
to the path of your template file. Require is thought for loading other modules.
@Component({
selector: 'home',
templateUrl: './home.component.html'
})
Upvotes: 1