2

I am using Angular 6 and I want to know if there is anything other than popstate to detect back button of the browser?

If it's possible, then please elaborate. If it isn't possible, my problem is that I have two sibiling components both want to detect the back button event. When on back click,component travels to another also i included window.history.forward() which goes front to the component (i.e) route will not change and on back button previous component"s popstate executes and due to window.history.forward() current component"s popstate also executes.

Is there any solution to this?

sdgluck
  • 24,894
  • 8
  • 75
  • 90

0 Answers0