0
虽然我将代码嵌入到template
标记中,但代码工作正常并显示内容。Angular2不适用于templateUrl
如果我将内容移动到templateUrl
控制台显示未找到的特定页面。
home.component.ts
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