If you set backdrop: 'static'
in your modalInstance
, solve the problem?
Like this:
var modalInstance = $modal.open({
...
backdrop: 'static',
...
});
Then, you need only control the ngClick button responsible to close the modal.
Hope this helps.
UPDATE 1 [only more info]
Use keyboard: false
for disable Escape
:
var modalInstance = $modal.open({
...
backdrop: 'static',
keyboard: false
...
});
UPDATE 2
I researched and found an option. In your modal controller, use:
$modalInstance.result.then(function (e) {
//...
}, function (e) {
//called before modal close
});
Example:
var modalInstance = $modal.open({
templateUrl: templateUrl,
controller: modalController
});
function modalController($scope, $modalInstance){
... //your code
$modalInstance.result.then(function (e) {
//...
}, function (e) {
//called before modal close
});
... //your code
}
But you need a way to not continue the events for to close the modal. Or allow user save the data before close modal. That's what got so far.
UPDATE 3
Check this.