当用户点击最终确认模式弹出窗口的关闭按钮时,我想关闭所有模态弹出框。
但是打开的模态窗口确实属于不同的控制器。这是片段:
function getQuickCasePopup($scope, $uibModal, $rootScope) {
var templateUrl = BasePath + 'App/Transaction/Views/common/QuickCaseSearch.tpl.html';
var controller = 'QuickCaseSearchCtrl';
OpenModal($scope, $uibModal, null, templateUrl, controller, null, null, '', $rootScope);
}
function getAddCasePopup($scope, $uibModal, $rootScope) {
var templateUrl = BasePath + 'App/Transaction/Views/common/CreateCase.tpl.html';
var controller = 'AddCaseCtrl';
OpenModal($scope, $uibModal, null, templateUrl, controller, null, null, '', $rootScope);
}
function getAdvanceCasePopup($scope, $uibModal, $rootScope) {
var templateUrl = BasePath + 'App/Transaction/Views/common/AdvanceCaseSearch.tpl.html';
var controller = 'AdvanceCaseCtrl';
OpenModal($scope, $uibModal, null, templateUrl, controller,null, null, 'lg', $rootScope);
}
function OpenModal($scope, $uibModal, $stateParams, templ, ctrl, grid, row, size, $rootScope) {
var CssClass = '';
if (size === 'lg') {
CssClass = 'app-modal-window';
}
var ModalInstance = ModalInstance || $uibModal.open({
animation: $scope.animationsEnabled,
templateUrl: templ,
controller: ctrl, // Logic in instantiated controller
windowClass: CssClass
});
确认弹出代码如下:
$( “#iConfirmationModal”)模态();
$("#iConfirmationModal").on('hidden.bs.modal', function () {
//$(".app-modal-window").dialog("close"); //Did not work
$state.go('transaction.search', {});
});
所以我想关闭所有模态弹出窗口然后重定向。我能实现同样的目标吗?
答案 0 :(得分:0)
模态是一个单例对象,所以你可以调用$ scope。$ close()并且它都关闭所有模态实例
答案 1 :(得分:0)
您可以有多个选项,