How to close spModal when switching from one modal to another?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2018 01:29 AM
Hi guys,
I need to close an open spmodal when I switch to a new modal opened by the latter.
What is the best way to do it?
I opened a modal via spmodal.open() in the client-side controller.
Thanks, Giovanni
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 12:46 PM
In case anyone else is facing this issue and doesn't want to use $uibModal. You can inject "$uibModalStack" into your client controller (since spModal wraps it).
Client Script/Controller:
function($scope, spModal, $uibModalStack) {
/* widget controller */
var c = this;
}
Then call when you want to close it... Note: this will close all open modals in the stack.
$uibModalStack.dismissAll();