I have lazy load app routing like below:
app.routing.ts
{
path: 'reports',
loadChildren: () => import('../Reporting/reporting.module').then(m => m.ReportingModule)
},
{
path: 'report-builder',
loadChildren: () => import('../Reporting/reporting.module').then(m => m.ReportingModule)
},
My lazy load module routes look like this
const routes: Routes = [
{
path: '',
children: [
{ path: '', component: ReportsComponent },
{ path: ':id',component: ViewReport},
{ path: '**', component: ViewReport }
]
},
{
path: '',
children: [
{ path: '', component: ReportBuilderComponent },
{ path: 'edit/:id', component: DesignReport },
{ path: '**', component: DesignReport }
]
}
I am trying to achieve, when user clicks on reports route, navigate to default Reportscomponent and when clicked on reportBuilder route, navigate to ReportBuilderComponent.
How to achieve this.