简体   繁体   中英

Clear Auxiliary Route before navigating to another route. @angular-4.0.2

I am using an aux route for popup, toast notifications which clears itself after couple of seconds after successful navigation. during that time the router.url equals to /home(aux:toast) , and if navigating to another route in that time the url becomes /detail(aux:toast) , but what I want is clear the aux route before navigating to another component.

One solution was when navigating to aux route I did following.

this.router.navigate([{outlets: {aux: 'toast'}}], {skipLocationChange: true})

this didnt changed the address bar url, but router.url still is /home(aux:toast)

and when navigating same thing happens address bar url changes to /detail(aux:toast)

它会起作用吗?

 router.navigate([{outlets: {aux: null])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM