0
votes

i used this method to navigate to named router-outlet => ( link -> [routerLink]="[{ outlets: { 'dashboard': ['userprofile'] } }] & Router-oulet -> ) , now how can i navigate to this router by a function? or how to use outlet name in "this.router.navigate" ?

route to this ->

<router-outlet name="dashboard"></router-outlet> 

by this link in html template ->

[routerLink]="[{ outlets: { 'dashboard': ['userprofile'] } }]

now, how can i navigate to the dashboard router-outlet by running a function? using this.router.navigate?

1
now, i used second router-outlet named "popup" **<router-outlet name="popup"></router-outlet> ** inside a modal and that shows error -> **cannot find the outlet pop to load ** ...?!Gokulraj Mahadheeraa
i solved it by writing the **<router-outlet name="popup"></router-outlet> ** under the primary <router-outlet>.. thumbs up!Gokulraj Mahadheeraa

1 Answers

3
votes

It should look more or less like:

this.router.navigate([{outlets: {'dashboard':'userprofile'}}],{
  relativeTo: this.route
});