How to disable modal closing using the modal ESC key in UI-Bootstrap?

0

In ui-bootstrap , I can disable modal closing by clicking on the black background using the {backdrop: 'static'} option.

But now I also need to disable the ESC key, because when you press this key, the modal is closed.

How to do this?

The modal I currently have looks like this:

$uibModal.open({

    templateUrl: '/ng-views/os/form.html',

    backdrop: 'static',

    controller: 'OSFormController'
});
    
asked by anonymous 25.09.2018 / 18:42

1 answer

1

You should set the keyboard option to false

$uibModal.open({
    templateUrl: '/ng-views/temp/os/form.html',
    backdrop: 'static',
    keyboard : false,
    controller: 'OSFormController'
});
    
25.09.2018 / 18:44