0

So we have an HTTP Interceptor that will prompt the user with a dialog (requiring a button press).

My question is how do I allow my UI Component to interface with the Http Interceptor to close this dialog if I wanted to. We are currently capturing BACK/FWD button presses and prompting if unsaved data is found. At the same time the back end service could have prompted with a dialog and the user simply wants to go back to his last page. That dialog is still up and I can't find a solution for how to close it. I've added a dialogRef to the HTTP inteceptor and a close() method to close it but I'm not seeing anyone who actually does anything like this?

  • I don't fully understand your requirements but if your goal is to close all dialogs in an interceptor you can use this https://stackoverflow.com/a/66602525/6236935 – Ivan Tarskich Mar 15 '22 at 11:25
  • 1. If every step have a separate component, so put condition in ngDestroy. 2. create observable function in service and maintain state, according to state pass check on that particular component and trigger this.dialogRef.closeAll(); event to close the dialog. – Abhishek Mar 15 '22 at 11:31

0 Answers0