Nuno_147
Nuno_147

Reputation: 2913

How to create a loading screen between angularJs routes

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

Answers (1)

Adam
Adam

Reputation: 1143

There definitely is.

$route

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

Related Questions