New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deepest outlet path as string with nested outlets path is parsed as multiple child routes #18928
Comments
The Plunker example isn't working. |
Same issue here. To highlight the workaround provided in the issue description, the simple solution is to enclose the deepest outlet values into square brackets As a side note, the official documentation example is enclosing values into square brackets: |
In the end, I'm not even sure this should be considered a bug: each named outlet destination is a set of commands as well, as for the main navigation API. This seems recursively consistent and allows "outlet branches" at any level in the hierarchy. |
There are many places where examples use just a string for the command in outlets. When using nested outlets, we do not correctly handle this case, as the types and algorithm always expect an array. This PR updates the `createUrlTree` algorithm to account for the possibility of a string literal as the command for an outlet. Fixes angular#18928
There are many places where examples use just a string for the command in outlets. When using nested outlets, we do not correctly handle this case, as the types and algorithm always expect an array. This PR updates the `createUrlTree` algorithm to account for the possibility of a string literal as the command for an outlet. Fixes angular#18928
There are many places where examples use just a string for the command in outlets. When using nested outlets, we do not correctly handle this case, as the types and algorithm always expect an array. This PR updates the `createUrlTree` algorithm to account for the possibility of a string literal as the command for an outlet. Fixes #18928 PR Close #39728
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
From
AppComponent's template
:<a [routerLink]="['/', { outlets: { 'primary': ['primary-app', { outlets: {'primary': 'primary-nested' } } ] } } ]">
navigates to/primary-app/(p/r/i/m/a/r/y/-/n/e/s/t/e/d)
.<a [routerLink]="['/', { outlets: { 'primary': ['primary-app', { outlets: {'primary': ['primary-nested'] } } ] } } ]">
navigates to/primary-app/primary-nested
.(3 examples in the plunk, and not only with 'primary' outlets)
Expected behavior
Both routerLink directives' command should reach
/primary-app/primary-nested
.Minimal reproduction of the problem with instructions
http://plnkr.co/edit/o0DFop?p=preview
This plunker illustrates this issue with 4 routes (primary RO under aux RO, primary under primary, aux under primary and aux under aux).
In the
Navigations below are absolute
section, you may reproduce that by clicking on the<a>
tags highlighted by ☝️ emoji.What is the motivation / use case for changing the behavior?
The behavior should be the same with and without nested outlets in path as
[routerLink]="['/', { outlets: { 'primary': 'primary-app' } } ]"
doesn't routes to/p/r/i/m/a/r/y/-/a/p/p/
:Environment
The text was updated successfully, but these errors were encountered: