24
我開始角度2計劃,我堅持了一個錯誤:ts1206裝飾這裏是無效的,角2
ts1206 decorators are not valid here
@Component({ // ts1206 decorators are not valid here
selector: 'my-app',
moduleId: module.id,
templateUrl: 'app.component.html',
styleUrls: ['app.component.css']
})
更新:
我tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
}
}
我該怎麼處理它?
了'@Component()'有直接在上課前要,做你在裝飾器下面有一個導出的類? –
你的'tsconfig.json'中有什麼? –
請參閱快速入門文章 - https://angular.io/docs/ts/latest/quickstart.html – Sanket