Pace: Track $http requests in angularjs?

2.5k Views Asked by At

Question from github:

https://github.com/HubSpot/pace/issues/154

I'm trying to get pace to work with my angularjs app. Everything works fine with page loads but when I make a $http call pace doesn't show the progress. Any ideas?

I tried using this library but it isn't as configurable as I would like, it does however with with $http. https://github.com/chieffancypants/angular-loading-bar

  • Tom
1

There are 1 best solutions below

2
Liam On BEST ANSWER

Try loading the following options before including pace.js in your index.html

window.paceOptions = {
    document: true, // disabled
    eventLag: true,
    restartOnPushState: true,
    restartOnRequestAfter: true,
    ajax: {
        trackMethods: [ 'POST','GET']
    }
};