【发布时间】:2022-08-22 17:47:16
【问题描述】:
我为延迟加载编写了以下代码。当我去相应的路线时,除了雇主模块之外的所有模块都加载得很好。你能告诉我我做错了什么吗
const routes: Routes = [
{
path: \'login\',
loadChildren: () =>
import(\'./login/login.module\').then((c) => c.LoginModule),
},
{
path: \'home\',
loadChildren: () =>
import(\'./login/home.module\').then((c) => c.HomeModule),
},
{
path: \'employer\',
loadChildren: () =>
import(\'./employer/employer.module\').then((c) => c.EmployerModule),
},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {}
-
您是如何得出这个模块没有按预期加载而其他模块没有加载的结论的!
标签: angular