4 ms·
Some suggestions from someone using AngularJS in a significant sized commercial project, which manages pages with complex DOM structures with tens of thousands
by beefsack 13y ago
Some suggestions from someone using AngularJS in a significant sized commercial project, which manages pages with complex DOM structures with tens of thousands of nodes on some pages:
* Don't modify the DOM with anything other than Angular, not with jQuery, not with anything. You will create a maintenance hell for yourself if you try to do things Angular isn't good at, but if you work well within it's strong areas you will achieve bliss.
* Make everything a directive if possible, Angular performs much better when you are dealing with much smaller scopes contained in directives.
* Angular watchers (including ng-repeat) can be very slow when handling large complex data sets. Create a $watch on the set length, and use that to create a flat index and ng-repeat over the index.