Last active
September 19, 2015 09:14
-
-
Save RajaJaganathan/d5c105f3f1544186cb5a to your computer and use it in GitHub Desktop.
AngularJS Setup load view/images poup when service call in progress
This file contains 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
var app = angular.module('myApp', | |
['myApp.services', 'myApp.controllers']); | |
app.run(['$rootScope', function($root) { | |
$root.$on('$routeChangeStart', function(e, curr, prev) { | |
if (curr.$$route && curr.$$route.resolve) { | |
// Show a loading message until promises aren't resolved | |
$root.loadingView = true; | |
} | |
}); | |
$root.$on('$routeChangeSuccess', function(e, curr, prev) { | |
// Hide loading message | |
$root.loadingView = false; | |
}); | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment