【问题标题】:AngularJS long list with ng-repeat perfomance issue具有 ng-repeat 性能问题的 AngularJS 长列表
【发布时间】:2014-12-08 03:11:11
【问题描述】:

我已经搜索了答案,但没有找到答案,如何解决 Angular 的性能问题? 没有第三方库,例如:

A) ReactJs B) 其他库...

export class ReportController implements ng.IScope {
     public contacts: Array<string> _contacts;
     private _scope: ng.IScope;

     constructor( $scope:  ng.IScope ) {
        this._scope = $scope;

        this._contacts = this.getContacts(); // return 15k result
     }
}

顺便说一句:通过 NOT WORKING 跟踪!不够快。

【问题讨论】:

  • 您希望人们如何帮助您?您没有提供任何相关代码或您正在做什么的描述。
  • 你试过track by $index吗?
  • 您能添加您的代码吗?给你一个答案会很有用。

标签: angularjs performance typescript angularjs-ng-repeat


【解决方案1】:

在这里,因为你用ng-repeat 标记了它,所以如果你的数据没有改变,你想查看一次绑定,例如this blog post(和the linked SO question)除了the documentation之外还有一个很好的概述。

【讨论】:

猜你喜欢
  • 2017-02-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-30
相关资源
最近更新 更多