How do I prevent angular-ui modal from closing?

Rahul Prasad picture Rahul Prasad · Nov 29, 2013 · Viewed 63.8k times · Source

I am using Angular UI $modal in my project http://angular-ui.github.io/bootstrap/#/modal

I don't want user to close the modal by pressing on backdrop. I want a modal can only be closed by pressing close button which I have created.

How do I prevent modal from closing ?

Answer

artur grzesiak picture artur grzesiak · Nov 29, 2013

While you creating your modal you can specify its behavior:

$modal.open({
   // ... other options
   backdrop  : 'static',
   keyboard  : false
});