【发布时间】:2017-05-07 10:05:31
【问题描述】:
我有一个生成对话框的例子,通过点击“显示模态”按钮,这里对话框被加载,然后如果我点击这个模态的按钮叫做“打开其他模态”,第二个对话框打开。当我单击任何模式的取消按钮时,我需要它,关闭对话框。目前有第二个对话框打开,如果我点击取消,只有第二个被关闭,当我尝试在第一个对话框中点击取消时,它不会关闭。我能做什么?
var modalInstance = null;
var modalScope = $scope.$new();
$scope.close = function (ok, hide) {
if(ok) {
//alert('ok');
} else {
//alert('cancel');
}
modalInstance.dismiss();
};
$scope.showModal = function() {
modalInstance = $modal.open({
templateUrl: 'myModal.html',
scope: modalScope
});
}
$scope.otherModal = function() {
modalInstance = $modal.open({
templateUrl: 'myModal2.html',
scope: modalScope
});
}
【问题讨论】:
-
请在此处包含代码示例。
-
@rckrd 好的。准备好了!
标签: javascript jquery angularjs angular-ui-bootstrap