Display Loading.. gif in angular-blockUI plugin

偶尔善良 提交于 2019-12-13 21:45:11

问题


I have used blockUI PLUGIN from https://github.com/McNull/angular-block-ui

Problem i'm facing is that i want to dislay loading gif along with Saving Synids... Message. So how can i do that.

$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!");
            });
    }

No changes has been done to jsp for this plugin.


回答1:


As per the documentation, you need to change the default value.

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

example

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;

});

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



来源:https://stackoverflow.com/questions/44261819/display-loading-gif-in-angular-blockui-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!