Modals 参数传递

来自ling
跳转至: 导航搜索
angular.copy(data, $scope.currentLegal);


app.controller('LegalListController', ['$rootScope', '$scope', 'APP_MEDIAQUERY', '$resource',"$uibModal", "$log",'$state', '$stateParams',
    function ($rootScope, $scope, appcontext, $resource,$uibModal, $log,$state, $stateParams) {
        $scope.open = function (size) {

            var modalInstance = $uibModal.open({
                templateUrl: 'LegalDetailController.html',
                controller: 'LegalDetailController',
                size: 'lg',
                width:"760",
                resolve: {
                    currentLegal: function () {
                        return $scope.currentLegal;
                    }
                }
            });

            modalInstance.result.then(function (currentLegal) {
                $scope.currentLegal = currentLegal;
            }, function () {
                $log.info('Modal dismissed at: ' + new Date());
            });
        }

app.controller('LegalDetailController', ["$scope", "$uibModalInstance", "currentLegal", function ($scope, $uibModalInstance, currentLegal) {

    $scope.currentLegal = currentLegal;

    $scope.ok = function () {
        $uibModalInstance.close($scope.currentLegal);
    };

    $scope.cancel = function () {
        $uibModalInstance.dismiss('cancel');
    };
}]);