Home:ALL Converter>Angular - Decoupling parent and child module routes completely

Angular - Decoupling parent and child module routes completely

Ask Time:2018-06-01T16:18:14         Author:JPS

Json Formatter

In angular application, to lazyload a module, we need to use the following way in routes,

{
        path: '',
        component: MyLayoutComponent,
        children: [
            { path: 'child', loadChildren: './child/child.module#ChildModule' }
        ]
}

In this way, for every new module, this routes file will get an update. Is there any way that i could still use child module without registering it in the 'children' array of parent module? So that development of a feature module will not have any effect on the parent module.

Author:JPS,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50639013/angular-decoupling-parent-and-child-module-routes-completely
yy