如何防止angular-ui模态关闭? [英] How do I prevent angular-ui modal from closing?

查看:60
本文介绍了如何防止angular-ui模态关闭?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中使用Angular UI $ modal http://angular-ui.github.io/bootstrap/#/modal

I am using Angular UI $modal in my project http://angular-ui.github.io/bootstrap/#/modal

我不希望用户通过在背景上按下来关闭模式.我希望只能通过按我创建的关闭按钮来关闭模态.

I don't want user to close the modal by pressing on backdrop. I want a modal can only be closed by pressing close button which I have created.

如何防止模式关闭?

推荐答案

在创建模态时,您可以指定其行为:

While you creating your modal you can specify its behavior:

$modal.open({
   // ... other options
   backdrop  : 'static',
   keyboard  : false
});

这篇关于如何防止angular-ui模态关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆