我试图为其他子孩子创建一个子孩子。我希望我的项目结构采用这种形式
其他路由模块 -othersubmodule(使用延迟加载加载) -other2submodule(使用延迟加载加载) 这是模块的代码
export const appRoutes: Routes = [
{ path: '', loadChildren: 'app/additional.module#AdditionalModule' },
{ path: 'login', component: LoginComponent },
{ path: 'change-password', component: ChangePasswordComponent },
{ path: 'not-allowed', component: NotAllowedComponent },
{ path: '**', component: NotFoundComponent }/**/
];
了解其他模块
export const routes: Routes = [
{
path: '', component: AppHomeComponent, children:
[
{ path: 'party', loadChildren: 'app/party/party.module#PartyModule' },
{ path: 'product', loadChildren: 'app/product/product.module#ProductModule' },
{ path: 'order', loadChildren: 'app/order/order.module#OrderModule' },
{ path: 'accounting', loadChildren: 'app/accounting/accounting.module#AccountingModule' }
]
}
];
所以错误是在访问additonalroutingmodule的子子进行路由时,它不会获得它将在括号中显示的路径 例如new / new-list(old / old-list)
答案 0 :(得分:0)
为appmodule提供父路径名称将解决问题