简体   繁体   中英

Avoid ng-repeat still using two way binding

My web application is huge and I often use ng-repeat to get list of datas. This leads slow performance, sometimes very annoying. I know different ways to avoid the ng-repeat but these ways suggests to use the One-time binding trick! I can't do it because my application needs to get the datas always updated. So, is there any other way to speed up the ng-repeat ? I'm still using a pagination to display my datas by the way. Thanks

First, use <div ng-repeat x in objects track by $index> Then, use :: (exactly as shown) for the variables where you don't want two way binding.

Something like:

{{::object.name}}

I'm on a phone so can't give you the exact syntax.

Let me know if you can't get it to work and i'll give you the exact syntax.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM