2

来自github的问题:

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

我正在努力加快使用我的 angularjs 应用程序的速度。页面加载时一切正常,但是当我进行 $http 调用时,速度并没有显示进度。有任何想法吗?

我尝试使用这个库,但它不像我想要的那样可配置,但是它可以使用 $http。 https://github.com/chieffancypants/angular-loading-bar

  • 汤姆
4

1 回答 1

6

在 index.html 中包含 pace.js 之前尝试加载以下选项

window.paceOptions = {
    document: true, // disabled
    eventLag: true,
    restartOnPushState: true,
    restartOnRequestAfter: true,
    ajax: {
        trackMethods: [ 'POST','GET']
    }
};
于 2017-02-14T21:11:26.927 回答