除一个模块外,所有模块都不会在延迟加载中加载



我为lazyloading编写了以下代码。当我走到它们对应的路线时,除了EmployerModule之外的所有模块都加载良好。你能告诉我做错了什么吗

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 {}

懒惰装载路线示例可能会有所帮助。

单击此处。。

最新更新