Angular2:没有延迟加载的路由器'loadChildren'相当于什么

Cle*_*ent 6 angular2-routing angular

我正在尝试"插入"包含路由配置(从中导入RouterModule.forChild())的子ngModule(功能模块)到父ngModule中.

使用延迟加载时,使用loadChildren父模块路由配置中的密钥指定"插入"子模块的位置.

例如:

export const parentModuleRouteConfig = [{
    path: 'myfeaturemodule',
    loadChildren: '/app/child.module'
}];
Run Code Online (Sandbox Code Playgroud)

实际上,我不想使用延迟加载.

如何告诉路由器"插入"(或使用)给定路径的子模块中指定的路由配置?

mak*_*n99 15

您仍然可以使用loadChildren同步加载.这个github问题有一些例子.

export const ChildRoutes: Routes = [
    { path: '', component: ChildComponent }
];
Run Code Online (Sandbox Code Playgroud)