Unexpected value 'undefined' declared by the module 'AppModule'

前端 未结 14 1820
庸人自扰
庸人自扰 2021-02-03 16:53

What is wrong here? I\'m trying to make it work but I get that error in the header. I have included the in the app

14条回答
  •  悲&欢浪女
    2021-02-03 17:17

    In My scenario, I made mistake like below

      @NgModule({
      imports: [RouterModule.forChild(routes)],
      exports: [RouterModule]
    })
    export class NewTestRoutingModule {
      static component : [NewTestContainerComponent, NewTestInletComponent, NewTestStructureComponent]
    }
    

    and in Module

    @NgModule({
      declarations: [LayersRoutingModule.component],
    

    The components array in Routing should be like this.

     static component = [NewTestContainerComponent, NewTestInletComponent, NewTestStructureComponent]
    

提交回复
热议问题