angular-tree-control icon indicating copy to clipboard operation
angular-tree-control copied to clipboard

Use ng-repeat with track by to prevent dupes and improve performance

Open andrewboni opened this issue 9 years ago • 3 comments

  • Prevents ng-repeat dupes error
  • Improve ng-repeat performance

andrewboni avatar Nov 03 '15 23:11 andrewboni

I have checked the commit, but some tests are failing - specifically regarding filtering

yoavaa avatar Nov 08 '15 12:11 yoavaa

track by should be placed after all filters ng-repeat="node in node.{{options.nodeChildren}} | filter:filterExpression:filterComparator {{options.orderBy}} track by $index"

melnikaite avatar Mar 11 '16 09:03 melnikaite

But where we must put this track by $index. I've try to add into template directly and is translated like:

  • The template it looks like: '<li ng-repeat="node in node.' + $scope.options.nodeChildren + ' | filter:filterExpression:filterComparator ' + orderBy + '" ng-class="headClass(node)" track by $index '+classIfDefined($scope.options.injectClasses.li, true)+'>' +

  • valikonen avatar Aug 22 '17 14:08 valikonen