11

I am using angular-bootstrap modal but I have an issue with modal-backdrop. I am new to angular-bootstrap, and I hope anyone can help me.

When I click on modal-backdrop it's hiding the modal popup, but I would like to keep the modal-backdrop until click cancel.

modal popup code is here

any one please suggest the solution for this.

Thanks

Gargaroz
  • 313
  • 9
  • 28
Pawan
  • 31,545
  • 102
  • 256
  • 434
  • Just a note that this is clearly explained in [our documentation](http://angular-ui.github.io/bootstrap/#/modal). Look at the `backdrop` option. Additionally, we have working plunker examples which which you can play with the options to see how they work prior to using them in your application. Please extend us and the community the courtesy of reading the documentation before asking for help. – icfantv Dec 22 '15 at 17:31

2 Answers2

14

If you use the Angular UI Bootstrap modal you can set backdrop to static (→ backdrop is present but modal window is not closed when clicking outside of the modal window):

var modalInstance = $modal.open({
  templateUrl: 'myModalContent.html',
  controller: ModalInstanceCtrl,
  backdrop: 'static',
  resolve: {
    items: function () {
      return $scope.items;
    }
  }
});

See plunker.

Reto Aebersold
  • 16,306
  • 5
  • 55
  • 74
4

There are main two property backdrop and keyboard in every model window.

  • Backdrop property In you can set two property backdrop = 'static' Clicking outside of model window,model window will not get closed with background will be grayed out.
    backdrop = 'false' Clicking outside of model window,model window will not get closed but background will not be grayed out. backdrop = 'true' Clicking outside window, model window will get closed.

  • keyboard property keyboard = 'false' By pressing esc key model window will not get closed.
    keyboard = 'true' By pressing esc key model window will get closed.

stackinfostack
  • 650
  • 2
  • 7
  • 12