georoot
georoot

Reputation: 3617

Progress bar with ngRoute in angularjs

Hi currently i am using ngRoute to fetch template from backend. but because of the size of template, it freezes till the template is loaded. What i want is a progress bar that shows the status of template as it is downloading .

I have found that ngProgress might be something that i want but i have not been able to integrate the same. Here is a small snippet for the ngRoute

App.config(function($routeProvider, $locationProvider) {
    $routeProvider
        .when('/', {
                templateUrl : '/templates/home.html',
                controller  : 'landing'
            })
        .when('/login', {
                templateUrl : '/templates/login.html',
                controller  : 'authCtl'
            })
        .when('/signup', {
                templateUrl : '/templates/signup.html',
                controller  : 'authCtl'
            })
        .otherwise({
                templateUrl : '/templates/404.html',
                controller  : 'mainController'
        });
    $locationProvider.html5Mode(true);
});

Upvotes: 0

Views: 304

Answers (1)

Luop90
Luop90

Reputation: 60

Have you tried angular-loading-bar? https://chieffancypants.github.io/angular-loading-bar/

Upvotes: 1

Related Questions