I have an angular app.I am using hash routing in angular8.I can detect browser back button event by subscribing router events( popstate). and changing route to ('/') root.But browser is taking to the previosly open page instead of root page.Any idea how to move to root page on browser back button?
Asked
Active
Viewed 181 times
0
-
Does this answer your question? [How do I detect user navigating back in Angular2?](https://stackoverflow.com/questions/40381814/how-do-i-detect-user-navigating-back-in-angular2) – John Kane Jun 08 '20 at 20:51
-
No it is not working.I am also able to detect popstate event but when i am changing route to root it is not going to root but the previous one on pression browser back button..this is my issue – user11561629 Jun 08 '20 at 20:59
-
can you show the code you are using? What I am wondering is if you need to cancel the even somehow to prevent it from completing. – John Kane Jun 08 '20 at 21:02