【问题标题】:Pace: Track $http requests in angularjs?Pace:在 angularjs 中跟踪 $http 请求?
【发布时间】:2018-08-21 22:39:04
【问题描述】:

来自github的问题:

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

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

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

  • 汤姆

【问题讨论】:

    标签: pace


    【解决方案1】:

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

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

    【讨论】:

    • 对于像我这样忽略了重要部分的人,load the options before including pace.js
    猜你喜欢
    • 1970-01-01
    • 2012-03-18
    • 2011-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-09
    • 2012-06-12
    相关资源
    最近更新 更多