我在角度5中实现了延迟加载,开发版本正在正常运行,但产品生成失败并出现错误错误:未捕获(承诺):TypeError:无法读取未定义的属性“ split” 在vendor.bundle.js中。
以下是我的路由配置。
app.routing.ts:
export const routes: Routes = [
{ path: '', redirectTo : "login", pathMatch: 'full' },
{ path: 'login', component: LoginComponent },
{ path: '', loadChildren: './lazymodule/lazymodule.module#LazymoduleModule' }
];
lazy.routing.ts:
export const routes: Routes = [
{
path: "", component: MenuComponent,
children: [
{ path: "android/devices", component: Android},
{path: "android/reports",component: AReports}
],
}
]