Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在angularJS中关闭模式后重新加载数据_Javascript_Html_Angularjs - Fatal编程技术网

Javascript 在angularJS中关闭模式后重新加载数据

Javascript 在angularJS中关闭模式后重新加载数据,javascript,html,angularjs,Javascript,Html,Angularjs,-->html代码 <button type="button" class="btn btn-primary" ng-click="platformAppConfigurationCreate()"> <span class="fa fa-plus"></span> <span class="hidden-xs hidden-sm"> Create </span> </button> 我想在模式弹出窗口

-->html代码

<button type="button" class="btn btn-primary" ng-click="platformAppConfigurationCreate()">
  <span class="fa fa-plus"></span>
  <span class="hidden-xs hidden-sm">
    Create
  </span>
</button>
我想在模式弹出窗口关闭后重新加载页面。我应该如何完成它?

我使用ngDialog

ngDialog.open({
    showClose: true,
    template: 'partials/directives/bibliographie/popupAdd.html',
    className: 'ngdialog-theme-default ngdialog-fullscreen',
    scope: $scope,
    closeByDocument: false,
    closeByEscape: true,
    controller: ['$scope', function ($scope) {

    }],
    preCloseCallback: function (value) {
        // called when you close modal
        if (value === 1) {
          ;
            return true;
        }

        return false;
    }
});
美元uibModal:

var modalInstance = $uibModal.open({
  templateUrl: 'a-template.html',
  controller: ['$scope', function($scope){
    $scope.$on('modal.closing', function(event, reason, closed){
        if('condition for not closing')
            event.preventDefault(); //You can use this to prevent the modal from closing            
        else
            window.location = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";            
    }
  }],
  controllerAs: 'modal',
  backdrop: false,
  size: 'lg'
}); 

处理关闭的事件并在那里执行代码

 $scope.platformAppConfigurationCreate = function() {
            $uibModal.open({
                templateUrl: 'app/entities/platform-app/platform-app-configuration-dialog.html',
                controller: 'PlatformAppConfigurationDialogController',
                controllerAs: 'vm',
                backdrop: 'static',
                size: 'lg',
                resolve: {
                    entity: function () {
                        return {
                            appConfigUuId: null,
                            appConfigName: null,
                            appConfigDesc: null,
                            appConfigDisplayImageRef: null,
                            appConfigExtraInfo: null,
                            id: null
                        };
                    }
                }
            }).closed.then(function(){

             //handle ur close event here
             alert("modal closed")

    }

您可以使用以下脚本

$scope.$on('modal.closing', function(event, reason, closed){
     //either reload the state
     $state.reload();   
   //or redirect to a url
    window.location.href="your url";

} 

当模态关闭时,有一个函数被调用。您使用的是angular ui吗?
$scope.$on('modal.closing', function(event, reason, closed){
     //either reload the state
     $state.reload();   
   //or redirect to a url
    window.location.href="your url";

}