MB. MB. - 10 months ago 106
AngularJS Question

AngularJS loading progress bar

When using AngularJS and doing a redirect using

the new page takes a while to load, especially on mobile.

Is there a way to add a progress bar for loading? Maybe something like YouTube has?

Luc Luc

For a progress bar as YouTube has, you can take a look at ngprogress. Then just after the configuration of your app (for example), you can intercept route's events.

And do something like:

app.run(function($rootScope, ngProgress) {
  $rootScope.$on('$routeChangeStart', function() {

  $rootScope.$on('$routeChangeSuccess', function() {
  // Do the same with $routeChangeError