Avoid ng-repeat still using two way binding

101 views Asked by At

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

1

There are 1 answers

0
Sean On

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.