Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角度-如何将路线分为模块?_Angular_Routing_Routes_Nativescript - Fatal编程技术网

Angular 角度-如何将路线分为模块?

Angular 角度-如何将路线分为模块?,angular,routing,routes,nativescript,Angular,Routing,Routes,Nativescript,我正在开发一个NativeScript w/Angular 8+应用程序 我有两个功能模块:身份验证和身份验证。 现在,我的所有路由都在一个主路由文件中:app-routing.module.ts 我如何将我的路线划分为各自的模块,并保持一切正常 e、 g 我希望我的主页和功能页位于经过身份验证的模块路由器中,其他页面位于身份验证模块中。通过在父路由文件中使用loadChildren导入功能模块(以及相应的路由): { path: 'authenticated', loadChi

我正在开发一个NativeScript w/Angular 8+应用程序

我有两个功能模块:身份验证和身份验证。 现在,我的所有路由都在一个主路由文件中:app-routing.module.ts

我如何将我的路线划分为各自的模块,并保持一切正常

e、 g

我希望我的主页和功能页位于经过身份验证的模块路由器中,其他页面位于身份验证模块中。

通过在父路由文件中使用
loadChildren
导入功能模块(以及相应的路由):

{
    path: 'authenticated',
    loadChildren: () =>
    import('./authenticated/authenticated.module').then(m => m.AuthenticatedModule),
}
AuthenticatedModule在内部导入AuthenticatedRoutingModule

编辑:查看角度文档(延迟加载)以了解更多信息:

{
    path: 'authenticated',
    loadChildren: () =>
    import('./authenticated/authenticated.module').then(m => m.AuthenticatedModule),
}