my template is as follows:
<router-outlet></router-outlet> <router-outlet name="rightpanel"></router-outlet>
let's say my url:
/
I want to go to page2 and remove the auxiliary socket using the routerLink directive. I tried the following methods:
[routerLink]="['/page2', {outlets: {rightpanel: null}} [routerLink]="['/page2', {outlets: {}}
In both cases, the page switches to rightpanel , but the rightpanel is still active. The only way I can decide is to put the following code in page constructor2:
this.router.navigate([{outlets: {rightpanel: null}}]);
which is not a good solution for many reasons.
Using angular 2.4.3, router 3.4.3
source share