Skip to content

Instantly share code, notes, and snippets.

@dmackerman
Created October 7, 2013 20:57
Show Gist options
  • Save dmackerman/6874811 to your computer and use it in GitHub Desktop.
Save dmackerman/6874811 to your computer and use it in GitHub Desktop.
loading
'use strict';
angular.module('JobNavsApp')
.factory('LoadingService', function ($rootScope) {
NProgress.configure({
trickleRate: 0.35,
trickleSpeed: 700
});
$rootScope.$on('$routeChangeStart', function() {
NProgress.start();
});
$rootScope.$on('$routeChangeSuccess', function(current, previous) {
NProgress.done();
});
$rootScope.$on('$routeChangeError', function(event, current, previous, rejection) {
/* do things */
console.log(rejection);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment