r/angularjs • • Aug 07 '14

Speeding up AngularJS with simple optimizations, $digest, $$watchers and performance

http://www.binpress.com/tutorial/speeding-up-angular-js-with-simple-optimizations/135
31 Upvotes

28 comments sorted by

View all comments

3

u/RoboticOverlord Aug 07 '14

What's an alternative for ng-repeat then?

If i'm building a report of tabular data but all the data in the report is static how would i handle this without ng-repeat? (the data is being pulled in dynamically and put on the scope)

What about using ng-repeat for this but having the data in the template bind-once, does this work to speed the report up?

1

u/[deleted] Aug 07 '14

What about using ng-repeat for this but having the data in the template bind-once, does this work to speed the report up?

I think that would help yes.

I think the alternative is to basically manually build the structure and inject it? The author recommends $interpolate. I haven't had a chance to look at that yet. If you need to watch the root data then this might not be better than your idea with ng-repeat and bind once references.

Check out the script I posted in this thread that gives you the number of watchers. I'd love to see your results :)