Adding this alternative answer.
Depending on your project, using $uibModalStack.dismissAll() may cause an error message.
As JB Nizet explained in this answer, this is because dismissAll() rejected the promise, resulting in dismissAll() ", as opposed to the success callback called by close() .
Failure to promise may result in an unwanted error handling procedure.
Given that $uibModalStack does not have closeAll() , I used this:
var modal = $uibModalStack.getTop(); while (modal && this.close(modal.key)) { modal = this.getTop(); }
This is the same behavior as $uibModalStack.dismissAll() but uses .close() instead of .dismiss() .
I could not find any documentation describing public methods for $uibModalStack , thus, in case anyone is interested in using / viewing other methods available in $uibModalStack .
Most likely it will be located in \node-modules\angular-ui-boostrap\dist\ui-boostrap-tpls.js and dismissAll() - @line 4349
It took me a while to find it.
mrOak Jul 22 '19 at 22:03 2019-07-22 22:03
source share