Angular browser back button

69 Views Asked by At

I want to implement a pop on browser back button in angular. I have used popstate as well as angular location api but nothing working as expected, can anyone suggest some solution

I have tried location api as well as popstate with host listener

1

There are 1 best solutions below

2
Ricudo On

You can use @HostListener('window:popstate', ['$event']) and when it is triggered show your pop.