Angular modal-backdrop issue

Pawan picture Pawan · Dec 20, 2013 · Viewed 24.7k times · Source

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

Answer

Reto Aebersold picture Reto Aebersold · Dec 20, 2013

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.