Error: Invalid configuration of route ''. One of the following must be provided: component, redirectTo, children or loadChildren
In app.module.ts,
RouterModule.forRoot([
{
path:'',
loadChildren:'./mainhomemodule/mainhomemodule.module#MainhomeModule'
}
])
In mainhome.module.ts,
RouterModule.forChild([
{
path:'',
component:HomeComponentComponent,
children:[{
path:'',
component:HomeComponent
}]
}
])
],
add in app-routing.module.ts file and you can direct access children component
app-routing.module.ts file
or you can try this code -> both are working
app.module.ts
blog.module.ts
blog-routing.ts file