In my application, it is using $modal.open()
function to open a modal popup which is using another page as a template. While clicking the button, it is showing the
$modal.open()
returns a object with a promise. You can use the promise and chain it though, and handle it in the catch. When you click on the backdrop outside, it does a dismiss
internally and it rejects the promise.
ex:-
var instance = $modal.open(...);
instance.result.then(function(){
//Get triggers when modal is closed
}, function(){
//gets triggers when modal is dismissed.
});
If you are using this in the child where $modalInstance
is injected you could do that there as well. So basically rather than dealing with event
this helps you do it at a higher level with the help of promises.