![](/img/trans.png)
[英]How to catch backdrop click event when clicked out of angular ui bootstrap modal?
[英]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.