How to catch backdrop click event when clicked out of angular ui bootstrap modal?

前端 未结 4 1072
青春惊慌失措
青春惊慌失措 2021-02-05 05:55

In my application, it is using $modal.open() function to open a modal popup which is using another page as a template. While clicking the button, it is showing the

4条回答
  •  被撕碎了的回忆
    2021-02-05 06:24

    You can use

    backdrop: 'static'
    

    in your options. Like this:

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

    The Bootstrap 3.0 Documentation explains that backdrop: 'static' specifies a backdrop that doesn't dismiss the modal on click.

提交回复
热议问题