Skip to content

[#117065785] add track by option#276

Closed
CyberCookie wants to merge 3 commits intodevelopfrom
ab_117065785_track_by_option
Closed

[#117065785] add track by option#276
CyberCookie wants to merge 3 commits intodevelopfrom
ab_117065785_track_by_option

Conversation

@CyberCookie
Copy link
Copy Markdown
Contributor

Added track by $index to repeaters with possible item count > 20

<ul class="media-list{{getListType()}}">
<!-- Items of the list -->
<li class="media" ng-repeat="_item in items | filter:searchText" checkbox-group>
<li class="media" ng-repeat="_item in items | filter:searchText track by $index" checkbox-group>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

track by $index is what it does by default, that doesn't gain us any speed improvements.

if we have an internal id for the element let's use that track by ID for example

@drKnoxy drKnoxy assigned CyberCookie and unassigned drKnoxy Apr 18, 2016
@drKnoxy
Copy link
Copy Markdown
Contributor

drKnoxy commented Apr 29, 2016

@CyberCookie this has a lot of bugs, do you want to take another crack at it?

@drKnoxy drKnoxy assigned CyberCookie and unassigned drKnoxy Apr 29, 2016
@CyberCookie
Copy link
Copy Markdown
Contributor Author

CyberCookie commented May 4, 2016

all ng-repeats are tracking by uniq key

ot-table-manager.directive.js takes different items object with different uniq keys in next situations: Products/Products vs Products/Attributes, as result items in this template tracked by $index.

Angular doesn't track repeater's items by $index by default, it just create $index for each iterable item

@CyberCookie CyberCookie closed this May 4, 2016
@CyberCookie CyberCookie reopened this May 4, 2016
@CyberCookie CyberCookie assigned drKnoxy and unassigned CyberCookie May 4, 2016
drKnoxy added a commit that referenced this pull request May 19, 2016
+ use track by more
+ use bind once in easy scenarios
@drKnoxy
Copy link
Copy Markdown
Contributor

drKnoxy commented May 19, 2016

merged

@drKnoxy drKnoxy closed this May 19, 2016
@vastbinderj vastbinderj deleted the ab_117065785_track_by_option branch June 11, 2016 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants