search

Home  >  Q&A  >  body text

angular.js - Can angular output data ng-repeat output 2500 items? Will there be too many jams?

Can angular output data ng-repeat output 2500 items?

为情所困为情所困2783 days ago613

reply all(4)I'll reply

  • PHP中文网

    PHP中文网2017-05-15 17:07:45

    AngularJS currently supports one-way binding to reduce consumption. If it is stuck, you can try adding double colons

    ng-repeat="value in ::values "
    
    The value inside

    can also be bound one-way, changed to

    {{ ::someValue }}
    

    To reduce the number of watches~

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-15 17:07:45

    No problem, since the CPU of the browser client is used, 2500 cycles is nothing. But under normal circumstances, there are rarely so many. If there is a lot of data, it will be paginated. It does not need to be done in one loop

    reply
    0
  • PHP中文网

    PHP中文网2017-05-15 17:07:45

    I tried about 4000 items, but the rendering data would be delayed, so I wrote settimeout+push to continuously push array elements into it.
    However, I found that there is no need to worry about ng binding monitoring, you should worry about dom scrolling card.

    reply
    0
  • ringa_lee

    ringa_lee2017-05-15 17:07:45

    You can refer to bindonce https://github.com/Pasvaz/bin... which can effectively solve the efficiency problems caused by watch

    reply
    0
  • Cancelreply