Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angualr js busy when routing

 app.directive('showDuringResolve', function($rootScope) {

      return {
         link: function(scope, element) {

              element.addClass('ng-hide');
              $rootScope.statechange =  true;

             var unregister = $rootScope.$on('$routeChangeStart', function() {
                element.removeClass('ng-hide');
                   $rootScope.statechange =  false;
            });

            scope.$on('$destroy', unregister);
          }
       };
     });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angualr #js #busy #routing
ADD COMMENT
Topic
Name
3+5 =