Raja Mohamed
Raja Mohamed

Reputation: 1026

Angular4 - Remove a page reference from pages history stack

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.

enter image description here

Upvotes: 3

Views: 1367

Answers (1)

angularconsulting.au
angularconsulting.au

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

Related Questions