Reputation: 1026
In my angular web application need to remove a page reference from angular page history stack . Ex : i navigate from login page to dashboard page now should remove login page reference from stack.
Upvotes: 3
Views: 1367
Reputation: 28269
I think you need to look in to https://angular.io/api/router/NavigationExtras#replaceUrl
You need to pass replaceUrl: true
when navigating to component, as per doc:
Navigates while replacing the current state in history.
// Navigate to /view
this.router.navigate(['/view'], { replaceUrl: true });
Upvotes: 7