I am using modal compoenent from the Bootstrap user interface ( https://angular-ui.imtqy.com/bootstrap/ ) in Angular to make modal, and when I close, I want to be able to redirect to another state, or at least call a function .
The problem is that I can catch the close event, but whenever the user presses Esc , the modal is rejected, and I could not find the documentation on how to catch the dismiss event or assign the function to the promise that returned.
The code is as follows:
var modalInstance = $uibModal.open({ templateUrl: 'a-template.html', controller: 'AnotherCtrl', controllerAs: 'modal', backdrop: false, size: 'lg' });
Alternatively, another solution that suits my business case would simply not allow the user to reject the modal. And close it yourself when an event occurs in the modal controller. I have not yet found functionality for this.
source share