Angular 2 relative pathing from siblings doesn't work #14480
Labels
area: router
freq3: high
P4
A relatively minor issue that is not relevant to core functions
router: aux routes
router: URL parsing/generation
state: confirmed
type: bug/fix
Milestone
I'm submitting a ... (check one with "x")
Current behavior
A routed component cannot use a relative path to navigate to another component; whether from the primary changing the named router outlet, or from a named router changing the primary.
The issue is written up here.
The closest routerLink syntax to navigating to a new named router outlet component is:
<a [routerLink]="['', {outlets: {aux: ['details']}}]">Details</a>
However, when a routed component is already in the aux named route, this routerLink produces an extra set of parenthesis.
If a routed component isn't already in the aux named route, then the url generated is malformed anyway.
Expected behavior
I would expect to be able to change to another route via a routerLink like the documentation says, regardless of the depth I am in the URL tree.
Minimal reproduction of the problem with instructions
https://plnkr.co/edit/uoUBG6yDfNb6P0oLKN16?p=preview
What is the motivation / use case for changing the behavior?
We have an application where the named router outlet is used to display lists of entities. Upon selecting an entity, the application replaces the primary router outlet with the details of the entity. Entity details control which lists are available, so navigation occurs in the primary router outlet to change which component is showing in the named router outlet.
Please tell us about your environment:
Azure App Services
Angular version: 2.4.7
https://unpkg.com/@angular/router@3.4.7/bundles/router.umd.js
Browser:
Chrome 56
Language: [all | TypeScript X.X | ES6/7 | ES5]
Node (for AoT issues):
node --version
=The text was updated successfully, but these errors were encountered: