I want to open a popup modal when the user clicks on the browser back button. It should not redirect the user to the previous page but it should open a popup and wait for user action.
ngOnDestroy(){
this.finishModal.show();
}
Currently, it's redirecting to the previous page and try to open the popup simultaneously which results in redirecting to the previous page and then a backdrop of the modal shows up on the page. I tried preventDefault() as well.
How to just open the modal and stop the execution of ngOnDestroy()?