Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

All items are re-rendered when filtering or adding items to the array #1721

Closed
alexbrad opened this issue Jul 12, 2016 · 1 comment
Closed

Comments

@alexbrad
Copy link
Contributor

When filtering or changing the array of items externally (by either adding or removing items), all the items are re-rendered. This happens because of the GroupNgRepeatExpression. Groups are tracked by $$hashKey and new groups are created whenever the array changes.

A solution would be to track groups by group name, since it is unique by definition. This can produce a significant performance improvement for large arrays of items. Is there any I am overlooking for which "track by $group.name" is not an option?

@vlio20
Copy link

vlio20 commented Jul 13, 2016

+1

alexbrad added a commit to alexbrad/ui-select that referenced this issue Jul 13, 2016
Use "track by" to track groups of choices by their name instead of
the $$hastKey. This way, existing items don't have to be
re-rendered when the array of items changes.

Closes angular-ui#1721
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants