Angular 2 Router Wildcard handling with child-routes

前端 未结 3 1905
遥遥无期
遥遥无期 2020-12-04 22:14

When using child routes with angular2\'s router \"3.0\", there is no need to declare them in the parent router config (before, you had to do something like /child...

3条回答
  •  佛祖请我去吃肉
    2020-12-04 22:28

    Simple solution is to reorder modules in the 'imports' array in app module file - ensure app/root router is the last item in the array; for example

    @NgModule({
      imports: [FeatureModule1, FeatureModule2, FeatureModule3, AppRouterModule]
      ...
      ...
    })
    

提交回复
热议问题