How to get the Route info without the aux route? The scenario is to close out the aux route, to do that I am thinking of stripping down the aux route info from the current route and navigate to new route,
So what I am looking for is to strip down aux1-route
from the current route.
/route1(aux1:aux1-route;id=123) -> /route1
/route1(aux1:aux1-route;id=123//aux2:aux2-route) -> /route1(aux2:aux2-route)
app.html
<router-outlet></router-outlet>
<router-outlet name='aux1'></router-outlet>
<router-outlet name='aux2'></router-outlet>
route configuration
{ path: "route1", component: route1Component }
{ path: "aux1-route", component: aux1RouteComponent, outlet: "aux1" }
{ path: "aux2-route", component: aux2RouteComponent, outlet: "aux2" }
Angular 2 version : 2.0.0-rc.5
Angular Router version : 3.0.0-rc.1
Please also suggest if there is any alternate way to close the aux route from anywhere in the application.
Thanks in advance!!
I was able to resolve this using below code,
this.router.navigate([{ outlets: { aux1: null } }]);
Check this Angular documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With