Angular router / auxiliary routes working once, bug (?) after
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
<div>
<a [routerLink]="['emails']">Emails</a>
<a [routerLink]="['contacts']">Contacts</a>
<a [routerLink]="[{outlets: {aux: ['auxiliary']}}]">Open an auxiliary route</a>
</div>
<router-outlet></router-outlet>
<router-outlet name="aux"></router-outlet>
So far, it’s nearly fine.
/emails
is diplaying fine/contacts
is diplaying fine/emails(aux:auxiliary)
is diplaying fine at loading/contacts(aux:auxiliary)
is diplaying fine at loading
When the auxiliary is in URL, it’s ok the first time we reach it.
But then, if I click on <a [routerLink]="['emails']">Emails</a>
, my aux outlet is not displayed anymore even tho the URL is still http://localhost:4200/emails(aux:auxiliary).
So my question is, how can we change the primary URL, without changing auxiliary routes ? (if no auxiliary, just go to new URL, if auxiliary, go to URL + auxiliary).
I tried :
<a [routerLink]="['emails', {outlets: {aux: ['/']}}]">Emails</a>
<a [routerLink]="['contacts', {outlets: {aux: ['/']}}]">Contacts</a>
and also
<a [routerLink]="['emails', {outlets: {aux: ['./']}}]">Emails</a>
<a [routerLink]="['contacts', {outlets: {aux: ['./']}}]">Contacts</a>
But it’s not working either.
Expected behavior
Stay on current primary route without changing auxiliary.
Reproduction of the problem
git clone https://github.com/maxime1992/angular2-nrgx-demo.git
git checkout auxiliary-route
npm i
ng serve
Please tell us about your environment:
Ubuntu 16.04 Node 6.5.0
-
Angular version: 2.0.0-rc.X
angular-cli: local (v1.0.0-beta.14, branch: master)
-
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Chromium 52.0.2743.116
-
Language: [all | TypeScript X.X | ES6/7 | ES5] Typescript
-
Node (for AoT issues):
node --version
=
6.5.0
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
+1
Fixed by https://github.com/angular/angular/pull/12412