(Angular-ui-router) Show loading animation during resolve process

后端 未结 11 844
生来不讨喜
生来不讨喜 2020-12-07 07:12

This is a two part question:

  1. I am using the resolve property inside $stateProvider.state() to grab certain server data before loading the controller. How wo

11条回答
  •  孤城傲影
    2020-12-07 08:11

    My Idea to use view while using resole in router it is working awesome. try this.

    //edit index.html file 
    
        
    // css file .loddingSvg { height: 100%; background-color: rgba(0, 0, 0, 0.1); position: absolute; z-index: 99; left: 0; right: 0; } .svgImage { background: url(../img/default.svg) no-repeat; position: relative; z-index: 99; height: 65px; width: 65px; background-size: 56px; top: 50%; margin: 0 auto; } // edit app.js .run(function($ionicPush, $rootScope, $ionicPlatform) { $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) { $rootScope.loadder = true; }); $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) { $rootScope.loadder = false; }); });

提交回复
热议问题