0

我正在尝试将 Angular5 应用程序重写为延迟加载的模块,但无法确定解析器未触发的原因。模块已正确加载,但解析器永远不会。我尝试了多种不同的组件,但总是面临同样的问题。我应该如何调试这个问题?

app.modules.ts

    {
        path: 'room',
        children: [
            {
                path: ':name',
                pathMatch: 'full',
                loadChildren: './expert/room/room.module#RoomModule',
                resolve: {
                    room: RoomResolver,
                },
            },
        ],
    },

room.module.ts

const routes: Routes = [
    {
      path: '',
      component: RoomComponent,
    }
  ];

@NgModule({
  imports: [
    CommonModule,
    BrowserModule,
    RouterModule.forChild(<any> routes),
  ],
  declarations: [RoomComponent],
})
export class RoomModule { }
4

0 回答 0