This is site info routing module
const routes: Routes = [
{
path: '', children: [
{
path: '',
component: WhyUsComponent
},
{
path: '',
component: WhoWeAreComponent
},
{
path: '',
component: WhatWeDoComponent
}
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class SiteInfoRoutingModule { }
Below is app routing module.The problem is that routerLink of all the routes go to the first component which is why-us in the site-info module. If I keep the path empty in the app routing module and instead add why-us who-we-are and career-with-us in the respective paths in the site-info-routing module then it works but is it the best way to manage it ?
{
path: 'why-us',
loadChildren: './site-info/site-info.module#SiteInfoModule',
},
{
path: 'who-we-are',
loadChildren: './site-info/site-info.module#SiteInfoModule',
},
{
path: 'what-we-do',
loadChildren: './site-info/site-info.module#SiteInfoModule',
}