Can angular output data ng-repeat output 2500 items?
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~
我想大声告诉你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
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.
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