Creating my first Angular 2 app I'm trying to set my template in an html file using templateUrl.
At the moment, I have the component.ts and the view.html in the same folder under src/ folder and I'm using this:
@Component({
selector: 'relative-path',
templateUrl: 'view.html'
})
Once running the app the console say:
zone.js:1274GET http://localhost:3000/personalData.html 404 (Not Found)
Any idea what I'm doing wrong?
Solved!
@Component({
selector: 'relative-path',
template: require('view.html')
})
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加