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

前端 未结 4 1070
青春惊慌失措
青春惊慌失措 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:42

    Catch all clicks on the html document, and close the modal.

    Catch clicks inside the modal and stop the propagation.

    i.e.

    $("html").on("click",closemodal());
    
    $(".modal").on("click",function(event){
       event.stopPropagation();
    }
    

提交回复
热议问题