I have:
- Main component
- -- First-Child component with parameter
- -- Second-Child component
The path of the First-Child and it's parameter: http://localhost/mpm/0776452c
Second-Child path should be: http://localhost/mpm/0776452c/settings
My problem is that I want to put the link for Second-Child component in Main component.
I tried this way: [routerLink]="'./settings'" but the generated link has round brackets in the end for some reason: http://localhost/mpm/0776452c/(settings)
Do you have idea how to fix this the easy way, because now I generate full path to Second-Child component ?
Thank you!
Edit: The link for Second-Child component is placed in Main component. The idea is when I'm in First-Child component (http://localhost/mpm/0776452c) I want to click on [routerLink]="'./settings'" which is in Main component so I can go to http://localhost/mpm/0776452c/settings
Edit 2 - my router config
{
path: '',
component: MainComponent,
canActivate: [AuthGuard],
children: [
{
path: 'mpm/:id',
component: FirstChild,
canActivate: [AuthGuard]
},
{
path: 'mpm/:id/settings',
component: SecondChild,
canActivate: [AuthGuard]
}
]
}