You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Childrouting inside auxiliary outlet works only in very specific cases #26672
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behavior
Routing inside auxiliary routes is broken.
Expected behavior
Same routing experience as inside primary routers. There should be no difference between routing inside primary router, auxiliary or nested routes. Each child route should be should behave consistently whatever parent outlet is.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Consistency in behavior of routing will prevent unexpected outputs.
Environment
Angular version: 6.1.10, 7.0.0
Browser:
- [ x] Chrome (desktop) version 69.0.3497.81 OS: Win7
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
@luckylooke Can you please add some more detail? Such as what actions you want me to take when reproducing and what the expected result should be? It looks like you put together some good samples, but your steps to reproduce don't tell me anything useful and the general statement that "Routing inside auxiliary routes is broken" also doesn't help as it doesn't say how it's broken or what exactly you're running into.
Yes I am really sorry I should review my question after some time to get 3rd person view on it :) Now I see how badly I wrote it, I did not left any context here or real steps.
Situation:
AppComponent ( root, have two outlets one unnamed and one named 'secondary' outlet )
AuxComponent ( has one unnamed outlet )
OneComponent, TwoComponent, ThreeComponent ( basic components, nothing special )
All routes configuration is in app.routing.module.ts.
Ok, so at first it loads in empty route state:
OneComponent is loaded into root primary outlet and AuxComponent is loaded in secondary outlet. As AuxComponent have nested outlet with children routes defined in router config, redirection should be applied to go to 'three' route. This is not happening.
Navigating to '/two' ([routerLink]="['two']"), pretty same scenario is expected in secondary outlet. Again no redirection happens.
Navigating explicitly to '/(secondary:three)' ([routerLink]="['', {outlets:{secondary:['three']}}]") works.
But navigating explicitly to '/two/(secondary:three)' ([routerLink]="['two', {outlets:{secondary:['three']}}]") does not, it throws error that it cannot match segment 'two'.
Navigating from '/(secondary:three)' to '/two' keeps secondary outlet untouched (ThreeComponent displayed), url is changed to '/two(secondary:three)' as expected.
But navigating from '/(secondary:three)' to '' or '/' removes navigation from secondary outlet. I am expecting same behaviour as for '/two' that secondary routing will be kept untouched.
Probably it will be better after applying recent fix 20cef50 by Igor.
<p><a [routerLink]="['two', {outlets:{secondary:['three']}}]">Navigate to /two(secondary:three)</a> = NOK(cannot match "two" segment)</p>
This should instead be:
a [routerLink]="[{outlets:{primary: 'two', secondary:['three']}}]">Navigate to /two(secondary:three)</a> = NOK(cannot match "two" segment)</p>
While the empty path child redirect is somewhat similar to #10726 but slightly different. In this case, I'm not sure the empty path parent with an empty path child redirect in the secondary outlet is a good idea - this effectively creates a situation where you would not be able to close the outlet. If you have a burning desire to see this added, please submit a new issue that is specific to that request.
Activity
jasonaden commentedon Nov 27, 2018
@luckylooke Can you please add some more detail? Such as what actions you want me to take when reproducing and what the expected result should be? It looks like you put together some good samples, but your steps to reproduce don't tell me anything useful and the general statement that "Routing inside auxiliary routes is broken" also doesn't help as it doesn't say how it's broken or what exactly you're running into.
luckylooke commentedon Dec 6, 2018
Yes I am really sorry I should review my question after some time to get 3rd person view on it :) Now I see how badly I wrote it, I did not left any context here or real steps.
Situation:
AppComponent ( root, have two outlets one unnamed and one named 'secondary' outlet )
AuxComponent ( has one unnamed outlet )
OneComponent, TwoComponent, ThreeComponent ( basic components, nothing special )
All routes configuration is in app.routing.module.ts.
Ok, so at first it loads in empty route state:
OneComponent is loaded into root primary outlet and AuxComponent is loaded in secondary outlet. As AuxComponent have nested outlet with children routes defined in router config, redirection should be applied to go to 'three' route. This is not happening.
Navigating to '/two' (
[routerLink]="['two']"), pretty same scenario is expected in secondary outlet. Again no redirection happens.Navigating explicitly to '/(secondary:three)' (
[routerLink]="['', {outlets:{secondary:['three']}}]") works.But navigating explicitly to '/two/(secondary:three)' (
[routerLink]="['two', {outlets:{secondary:['three']}}]") does not, it throws error that it cannot match segment 'two'.Navigating from '/(secondary:three)' to '/two' keeps secondary outlet untouched (ThreeComponent displayed), url is changed to '/two(secondary:three)' as expected.
But navigating from '/(secondary:three)' to '' or '/' removes navigation from secondary outlet. I am expecting same behaviour as for '/two' that secondary routing will be kept untouched.
Probably it will be better after applying recent fix 20cef50 by Igor.
Maybe also Maxim's #25483 could help.
Thank you for your time! You are awesome! :)
jasonaden commentedon Dec 18, 2018
Thanks for the update! We tried to merge the commit 20cef50 which was actually submitted by a community member.
We had an issue internally that caused that commit to be reverted, but we will be looking at getting it merged again as soon as possible.
I'll take a look at the additional info. Thanks!
atscott commentedon Nov 17, 2020
Closing as duplicate of #13523 for the
This should instead be:
While the empty path child redirect is somewhat similar to #10726 but slightly different. In this case, I'm not sure the empty path parent with an empty path child redirect in the secondary outlet is a good idea - this effectively creates a situation where you would not be able to close the outlet. If you have a burning desire to see this added, please submit a new issue that is specific to that request.
angular-automatic-lock-bot commentedon Dec 19, 2020
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.