Avi K.
Avi K.

Reputation: 655

Loading page with AngularJS routes

I want to use Angular routes for creating small website for mobile. Is there any way to add loading icon while loading a partial and swap the entire page to the right when switching? (like in native mobile app animation

Upvotes: 1

Views: 851

Answers (2)

James Tyrrell
James Tyrrell

Reputation: 393

But change:

  • $beginRouteChange to $routeChangeStart
  • $endRouteChange to $routeChangeSuccess

and things will work.

Upvotes: 3

Max
Max

Reputation: 8836

Check out Misko's answer about delaying route changing. He links to an example, too which is helpful. Basically, you have to add to your routing logic a resolve function which will allow you to prevent showing of the new route until asynchronous calls are resolved, and observing the $beginRouteChange and $endRouteChange on the $rootScope (example code here)

Upvotes: 1

Related Questions