How to get all open models of application and close them all


Topic: How to get all open models of application and close them all

raphael_tec360 pro premium asked 3 years ago

Expected behavior When there is a need to forcefully log out user by closing all open models, There should be a way to close all models which are in an open state from the root component i.e AppComponent

Actual behavior There is no way to get and close all open models. MdbModalService has only one method of the opening model only

Resources (screenshots, code snippets, etc.) NA


Arkadiusz Idzikowski staff answered 3 years ago

@raphael_tec360 We currently don't have such a feature in modal service, I added it to our nice-to-have list and we will consider implementing it in the future.

As a workaround for now you can try to store the active modalRef list in some custom global service and use its close methods to remove the active modals.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: MDB5 1.6.1
  • Device: Windows
  • Browser: Chrome
  • OS: 10
  • Provided sample code: No
  • Provided link: No