How to disable modal closure via the ESC key in the modal of the UI-Bootstrap?

Asked

Viewed 485 times

0

In the ui-bootstrap, i can disable the modal closure by clicking on the black background through the option {backdrop: 'static'}.

But now I also need to turn off the key ESC, because when you press that button, the modal is closed.

How to do this?

The modal I currently have is like this:

$uibModal.open({

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

    backdrop: 'static',

    controller: 'OSFormController'
});

1 answer

1


You must configure the option keyboard for false

$uibModal.open({
    templateUrl: '/ng-views/temp/os/form.html',
    backdrop: 'static',
    keyboard : false,
    controller: 'OSFormController'
});
  • That’s right. It worked. Thanks :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.