In Angular 2.0 to navigate to other route we can use route.navigate( [ 'routeName' ] )
. But this action will store the current route in browser history.
What is the method to replace the current route in browser history and navigate to new route.
See this: https://angular.io/docs/ts/latest/api/router/index/NavigationExtras-interface.html
You have to use the option replaceUrl instead of skipLocationChange. It will send you to the new url but the current one will NOT be preserved, so pressing back will not send you back to this page.
this.router.navigate(['login'],{replaceUrl:true});
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