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
feat(ngFor): add custom trackBy function support #6779
Conversation
9c10d95
to
675bb1c
Compare
88e3628
to
6771d46
Compare
@@ -42,6 +43,10 @@ export class DefaultIterableDiffer implements IterableDiffer { | |||
private _removalsHead: CollectionChangeRecord = null; | |||
private _removalsTail: CollectionChangeRecord = null; | |||
|
|||
constructor(private _trackByFn?: TrackByFn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do _trackByFn: TrackByFn = trackByIdentity
instead? Try to do this if ts2dart supports it. If not, what you have is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's what I wanted to do too :) It doesn't seem to be supported.
788420c
to
26b72a4
Compare
Make it possible to track items in iterables in custom ways (e.g. by ID or index), rather than simply by identity.
Merging PR #6779 on behalf of @alexeagle to branch presubmit-alexeagle-pr-6779. |
linking to the new issue #6872 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Make it possible to track items in iterables in custom ways (e.g. by ID or index), rather than simply by identity.
Usage:
With template element:
With *ngFor:
@mhevery Did you want to review this?
Closes #4402