2017-05-30 77 views
0

我已經從https://github.com/McNull/angular-block-ui顯示中.. GIF在角blockUI插件

問題我面對使用blockUI插件是,我想與保存Synids ...消息沿dislay加載GIF。 那麼我該怎麼做。

$scope.saveDefSynId = function(item, event) { 
     if($rootScope.savedSynids.length!==0){ 
      **blockUI.start({message: 'Saving Synids...'});** 
      var toSaveSynid=[]; 

      angular.forEach($rootScope.savedSynids, function(value){ 
       if(value.isSaved=='Y'|| value.isUpdated=='Y'){ 
        toSaveSynid.push(value); 
       }  
      }); 

      var clientId=$scope.selClient; 
      var responsePromise = $http.post("defineSaveSynId/"+clientId,toSaveSynid); 

      responsePromise.success(function(data, status, headers, config) { 
       $rootScope.savedSynids=[]; 
       $scope.eMsg="Synids Saved Successfully"; 
       **blockUI.stop();** 
      }); 
      responsePromise.error(function(data, status, headers, config) { 
       alert("AJAX failed!"); 
      }); 
    } 

此插件的jsp沒有變化。

回答

0

根據文檔,您需要更改默認值。

// Change the default overlay message 
blockUIConfig.message = 'Saving Synids...'; 

例如

angular.module('myApp').config(function(blockUIConfig) { 

    // Change the default overlay message 
blockUIConfig.message = 'Saving Synids...'; 

// Change the default delay to 100ms before the blocking is visible 
blockUIConfig.delay = 100; 

}); 

源:http://angular-block-ui.nullest.com/#!/examples/documentation

+0

我已經改變使用blockUI.start默認消息的值({消息: '保存Synids ...'}); –