Although it looks trivial, I didn't find any similar cases Here's my route :
{
path: 'folder/:id',
component: FolderComponent,
children: [
{
path: 'edit/:form',
component: 'EditorComponent'
}
]
}
When I'm on edit/form1
page, I can't find the way to specify my routerLink directive so that it just changes the :form
value, without losing the parent :id
value.
For now, I need to do that :
1 <a [routerLink]="['../../edit, 'form2']">Form2</a>
to get two level up. This works. But it's not that elegant...
2 I tried ['edit', 'form2']
, it brings me to folder/:id/edit/form1/folder/form2
3 If I do ['/edit', 'form2']
, I get /folder/form2
4 I even tried ['', 'form2']
, I get /form2
edit :
5 As suggested I tried ['./edit', 'form2']
, but it gives me folder/:id/edit/form1/edit/form2
Just to precise, my link is in editor-component.html
and the current url is http://myapp.com/folder/:id/edit/form1
Thx for your help
folder/:id/edit/form1/edit/form2
. Maybe I forgot to precise that my navbar is oneditor-component.html
and my current url ishttp://myapp.com/folder/:id/edit/form1
– Irritation