Angular modal background problem

I am using angular-bootstrap modal, but I have a problem with modal background. I am new to angular-bootstrap and I hope someone can help me.

When I click on the modal background, it hides the modal popup, but I would like to keep the modal background until the click is canceled.

modal pop-up code here

Anyone please suggest a solution for this.

thanks

+8
angularjs modal-dialog angular-ui-bootstrap
source share
2 answers

If you use Angular UI Bootstrap modal , you can set backdrop to static (→ there is a background, but the modal window is not closed when clicked outside the modal window):

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

See plunker .

+11
source share

Each model window has two main properties and a keyboard.

  • Background Properties You can set two properties backdrop = 'static' By clicking outside the model window, the model window will not be closed with the background grayed out .
    backdrop = 'false' When you click on the external model window, the model window will not be closed, but the background will not be grayed out . backdrop = 'true' When you click on an external window, the model window closes.

  • keyboard property keyboard = 'false' By pressing the esc key button, the model window will not be closed.
    keyboard = 'true' By pressing the esc key, the model window closes.

+1
source share

All Articles