Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dismiss all option in modal service #1963

Closed
jcimoch opened this issue Nov 15, 2017 · 7 comments
Closed

Dismiss all option in modal service #1963

jcimoch opened this issue Nov 15, 2017 · 7 comments

Comments

@jcimoch
Copy link

jcimoch commented Nov 15, 2017

Feature request:

I think there should be an option to dismiss all instances.
For example let's imagine that we have http interceptor which redirects on 401 http error code to login page. From interceptor prespective we don't have infromation about current modal reference. After redirection modal stays opened. It would be nice to be able to close all instances without explicit reference to modal template.

If I'm missing something, and that feature already exists please point me to docs, cause I coulnd't find it.

@kukac7
Copy link
Contributor

kukac7 commented Nov 15, 2017

https://stackoverflow.com/questions/40382319/how-to-programatically-close-ng-bootstrap-modal

@jcimoch
Copy link
Author

jcimoch commented Nov 15, 2017

This doesn't solve the problem. I still need NgbModalRef to be able to close it.

@pmcochrane
Copy link

This would be a nice feature to have. My reason for needing this is that if the user is automatically logged/timed out then modals are left open on screen although the page has rerouted to the login screen.

If the modalService could cache all the NgbModalRef's on a call to open (& also clear them when the modal is closed/dismissed) then can we get a function on the modalService to closeAllActiveModals?

My current workaround is having to wrap every call in my app that opens a modal to also store the NgbModalRef in another app wide service array. Then I have a function to attempt to close all modals in the array when the user is logged out.

@jaredmartinez
Copy link

+1

@texiontech
Copy link

+10000

@jcimoch
Copy link
Author

jcimoch commented Apr 4, 2018

Is this feature planned for some release?

@tiboprea
Copy link

tiboprea commented Jun 8, 2018

+1

divdavem added a commit to divdavem/ng-bootstrap that referenced this issue Aug 20, 2018
divdavem added a commit to divdavem/ng-bootstrap that referenced this issue Aug 21, 2018
divdavem added a commit to divdavem/ng-bootstrap that referenced this issue Aug 21, 2018
@divdavem divdavem mentioned this issue Aug 21, 2018
5 tasks
divdavem added a commit to divdavem/ng-bootstrap that referenced this issue Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants