Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 788
Raja Mohamed Avatar asked Dec 07 '25 08:12

Raja Mohamed


1 Answers

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 });
like image 60
angularrocks.com Avatar answered Dec 09 '25 20:12

angularrocks.com