Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewboni
Copy link

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

@yoavaa
Copy link
Contributor

yoavaa commented Nov 8, 2015

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

@melnikaite
Copy link

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

@valikonen
Copy link

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)+'>' +

  • Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    4 participants