I have the following routing configuration in my Angular 6 project.
path: 'chart/:feature',
component: ChartStateComponent,
canActivateChild: [ChartGuardService],
children: [
{
path: ':id',
redirectTo: '/chart/:feature/:id/profile',
pathMatch: 'full'
},
{ path: ':id/:tab',
component: TestOneComponent,
pathMatch: 'full'
}
]
feature
is param to parent path and it can 4 different values like one
, two
, three
and four
. Now depending on this param, I need to set the component for children
path.
For example, if feature
is set one
, then set TestOneComponent
as children component.
How can i achieve this?