Angular 2 | Directives Argument of type '{}' is not assignable to

后端 未结 4 1591
挽巷
挽巷 2020-12-02 22:53

I am noob with Angular 2. I am doing YouTube tutorials, but every tutorial have the directives: part where i am stuck.

app.component.ts

4条回答
  •  日久生厌
    2020-12-02 23:12

    directives property was removed in RC.6

    You should move it to declarations property of your NgModule decorator

    @NgModule({
      imports:      [ BrowserModule ],
      declarations: [ AppComponent, HeaderComponent ], <== here
      bootstrap:    [ AppComponent ]
    })
    export class AppModule { }
    

提交回复
热议问题