繁体   English   中英

在AngularJS模态窗口中单击背景的捕获事件

[英]Catch event of backdrop click on AngularJS 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 () {
        });

但是,当我单击打开的模式窗口时,它将关闭。 当用户在模式窗口中单击时,我想捕获事件。 我的模态控制器:

app.controller = function(){}

和模式视图:

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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