Reputation: 2913
I would like to create a loading screen with an animated gif when routing in my AngularJs app.
Is it possible to make something generic for this ?
Upvotes: 1
Views: 345
Reputation: 1143
There definitely is.
Check out the events available to you from the $route service.
$routeChangeStart, $routeChangeSuccess, and $routeChangeError will be the most useful. You can listen for these easily on the $rootScope and implement whatever logic you need to show a loading animation or otherwise.
Upvotes: 4