MB. MB. - 1 year ago 146
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
Answer Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download