How to Route to Feature Module

前端 未结 3 841
猫巷女王i
猫巷女王i 2020-11-30 15:41

I\'m trying to have a route from one module include a component from another module. The scheme I\'m trying to implement is: /group/feature which should show th

3条回答
  •  自闭症患者
    2020-11-30 16:28

    You have defined the route for 'group'. You haven't defined the route 'group/feature'.

    Update:

    Your group route looks like a plain route to /group, but group is actually a child module and you don't load the component, you loadChildren.

    const routes: Routes = [
        {path: '', pathMatch: 'full', redirectTo: 'group'},
        {path: 'group', loadChildren: 'app/group/group.module#GroupModule},
        {path: '**', component: PageNotFoundComponent}
      ]
    ;
    

提交回复
热议问题