app.controller("commonCtl", function ($scope, $uibModal) { $scope.openDialog = function () { var modalInstance = $uibModal.open({ templateUrl: 'dialog.html', controller: 'formCtl', windowClass: 'window', size: 'lg', resolve: { data: function () { return $scope.data; } } }); modalInstance.result.then( function (data) { // 关闭时回传过来的值($uibModalInstance.close(data)) $scope.data = data; }, function (reason) { // 取消时 // 点击空白区域:backdrop click // 点击取消:cancel } ); }; }) app.controller("formCtl", function ($scope, $uibModalInstance, data) { $scope.data = data; $scope.close = function () { $uibModalInstance.close($scope.data); // 关闭时回传数据 } })