I am having two main routes, both loading same child module. Is there any possible way to have two routes with same name on the child module that loads two different components with respect to the main route.
Main Routes:
export const ROUTES: Routes = [{
path: 'first',
loadChildren: './features/common#CommonModule',
canActivate: [AppAuthGuard]
}, {
path: 'second',
loadChildren: './features/common#CommonModule',
canActivate: [AppAuthGuard]
}]
Now I'm expecting the common module to have routes something like this
export const routes = [{
path: 'list', component: FirstListComponent, pathMatch: 'full' }
},{
path: 'list', component: SecondListComponent, pathMatch: 'full' }
}]
So, I want something like
I know that the order of the routes matters. And the proposed way is not possible. Can anyone suggest any possible way to achieve this.
Please set path like this
export const routes = [{
path: 'first/list', component: FirstListComponent, pathMatch: 'full' }
},{
path: 'second/list', component: SecondListComponent, pathMatch: 'full' }
}]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With