Title text ##The following is my code. After clicking cancel, the value of the select box will still change
//views
< select class="mei-select mei-select-md" ng-model="nextparam.emscaapportionh.imp_erp_type" ng-options="m.itemValue as m.itemName for m in impErpTypes" ng-disabled="!isErpTypeEdit" ng-change="impErpTypeChange()" > </select >
//ngDialogCtrl
(function () {
'use strict';
angular.module('app')
.controller("ngDialogCtrl", ['$scope',
function ($scope) {
$scope.msg = $scope.dialog ? $scope.dialog.msg : '确认要执行吗?';
}
]);
})();
//业务逻辑
$scope.openConfirmDialog = function (callback, msg) {
$scope.dialog = {
msg: msg
};
ngDialog.openConfirm({
template: 'app/app_common/views/ngdialog.confirm.html',
plain: false,
showClose: true,
closeByDocument: true,
closeByEscape: true,
scope: $scope,
width: '20%',
controller: 'ngDialogCtrl'
}).then(callback);
};
//修改导ERP类型
$scope.impErpTypeChange = function () {
var impErpTypeChangeFun = function () {
$scope.budgetGridOptions.data = [];
};
$scope.openConfirmDialog(impErpTypeChangeFun, '更改导类型将会清空明细,是否继续?');
}
After looking at the ngDialog api, just add a preCloseCallback attribute