简体   繁体   中英

Catch event of backdrop click on AngularJS modal window

I create a modal window

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

modalInstance.result.then(function (result) {
            alert("Success");
        }, function () {
        });

But when I click over the opened modal window, it closes. I want to catch event, when user clicked over the modal window. My modal controller:

app.controller = function(){}

and modal view:

<div class="modal">
    <div class="modal-dialog">
         <div class="modal-content">
              Hello
 </div></div></div>

查看有关ng鼠标事件的文档,我认为这是您在寻找的https://docs.angularjs.org/api/ng/directive/ngMouseup

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM