当我编译我的应用程序与tsc我得到这个错误TS2345:
error TS2345: Argument of type '{ selector: string; template: string; directives: (typeof Title | any[])[]; providers: typeof Goo...' is not assignable to parameter of type 'ComponentMetadataType'.
这里是我的代码:
import { Component,Input } from "@angular/core"; import { Title } from "./components/title"; import { Timeline } from "./components/timeline"; @Component({ selector: "edu",template: ` <div id="Edu" class="Edu content section scrollspy"> <title [icon]="titleIcon" [title]="titleTitle"></title> <timeline [data]="edu"></timeline> </div> `,directives: [Title,Timeline] }) export class Edu { private titleIcon = "graduation-cap"; private titleTitle = "Education"; @Input("data") edu: Array<Object>; }
我的代码中没有看到任何错误,也是以前的工作。任何人都可以看到有什么问题吗?
注意:我使用Angular2-rc6和TypeScript 1.8.10,希望这些信息有所帮助