From angular docs :
The router link directive always treats the provided input as a delta to the current url.
For instance, if the curre
As of May, 2020, there was no working answer to the initial question which can be used with the builtin [routerLink]
, so here it comes.
In your question, the ['/user/jim', { outlets: { aux: null }}]
idea was good, but you have to specify the primary outlet explicitly:
<a [routerLink]="['/', { outlets: { primary: 'user/jim', aux: null } }]">
This will be a link to '/user/jim', without any route in the aux path
</a>
(As far as I know, there is no way currently to use [routerLink]
with an absolute url without cancelling possible outlets.)
You can follow the same logic for your EDIT. If you don't change the aux outlet, but set the primary explicitly to empty (the root), you can navigate to the root and keep the current outlet(s):
[routerLink]="['/', { outlets: { primary: '' } }]"