When using AngularJS and doing a redirect using $location.path(\'/path\')
the new page takes a while to load, especially on mobile.
Is there a way to ad
Since @Luc's anwser ngProgress changed a bit, and now you can only inject ngProgressFactory
, that has to be used to create ngProgress instance. Also contrary to @Ketan Patil's answer you should only instantiate ngProgress once:
angular.module('appRoutes', ['ngProgress']).run(function ($rootScope, ngProgressFactory) {
// first create instance when app starts
$rootScope.progressbar = ngProgressFactory.createInstance();
$rootScope.$on("$routeChangeStart", function () {
$rootScope.progressbar.start();
});
$rootScope.$on("$routeChangeSuccess", function () {
$rootScope.progressbar.complete();
});
});