Angularjs 单击对话框外部时,角度ui modalinstance不会关闭
我的代码如下所示:Angularjs 单击对话框外部时,角度ui modalinstance不会关闭,angularjs,Angularjs,我的代码如下所示: var itemDetails = item; var modalInstance = $modal.open({ backdrop: 'static', keyboard: true, templateUrl: 'template/itemDetailsPopup.html', con
var itemDetails = item;
var modalInstance = $modal.open({
backdrop: 'static',
keyboard: true,
templateUrl: 'template/itemDetailsPopup.html',
controller: 'itemDetailController',
resolve: {
itemDetails: function() {
return itemDetails;
}
}
});
通过这种方法,我成功地打开了对话框,但当我触摸到对话框外部时,问题应该会关闭它,但不幸的是,它没有发生。
如何启用该功能?这是来自:
背景(类型:布尔|字符串,默认值:true)-控制
背景。允许的值:真(默认)、假(无背景),
“静态”(通过单击背景禁用模式关闭)
因此,基本上,通过使用配置选项background:“static”
可以显示背景,但不能使用背景关闭模式
您想要的是background:true
这是来自:
背景(类型:布尔|字符串,默认值:true)-控制
背景。允许的值:真(默认)、假(无背景),
“静态”(通过单击背景禁用模式关闭)
因此,基本上,通过使用配置选项background:“static”
可以显示背景,但不能使用背景关闭模式
您想要的是
background:true
我尝试使用background:true
,但当我触摸屏幕的其他部分时,它没有关闭。您可以提供一个plunker或类似的显示问题的工具吗?我尝试使用background:true
,但当我触摸屏幕的其他部分时,它不会关闭。你能提供一个plunker或类似的显示问题的工具吗?