0
template
タグにコードを埋め込んでいますが、コードは正常に動作しており、コンテンツを表示しています。Angular2 templateUrlで機能しません
コンテンツをtemplateUrl
に移動すると、特定のページが見つからないことがコンソールに表示されます。
import {Component} from "@angular/core";
@Component({
selector: 'home',
templateUrl: 'home.component.html'
})
export class HomeComponent{
}
tsconfig.js
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
}
}
Plunkerで再現できますか? –
また、https://angular.io/docs/ts/latest/cookbook/component-relative-paths.htmlをチェックしてください。 – ranakrunal9
'@ Component'にあなたが持っているものを投稿できますか? – brians69