Created
October 7, 2013 20:57
-
-
Save dmackerman/6874811 to your computer and use it in GitHub Desktop.
loading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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