Atlas91
Atlas91

Reputation: 5904

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

Upvotes: 0

Views: 101

Answers (1)

Sean
Sean

Reputation: 1364

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.

Upvotes: 2

Related Questions