如何防止 angular-ui 模式关闭?
问题描述:
我在我的项目中使用 Angular UI $modalhttp://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
});