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

[feat] add trackById and trackByProp directives #33

Closed
dmorosinotto opened this issue Sep 13, 2023 · 2 comments
Closed

[feat] add trackById and trackByProp directives #33

dmorosinotto opened this issue Sep 13, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@dmorosinotto
Copy link
Contributor

Don't you mind if I'll add this function?
https://gist.github.com/dmorosinotto/8deeb5b2db6c6dfcb9a927268ef85745
They are two standalone directives to help/easy handle trackBy in *ngFor , the original code is inspired by this article

@nartc
Copy link
Collaborator

nartc commented Sep 13, 2023

Go for it!

@nartc nartc added the enhancement New feature or request label Sep 13, 2023
@dmorosinotto
Copy link
Contributor Author

dmorosinotto commented Sep 15, 2023

@nartc I'll start to implement this, now that I have some "practice" with the other PR
I only have 1 question: what kind of test can I create for something like trackBy??

I'm NOT a test expert, but can't think of something "useful" to test if the directive trackById and trackByProp really works, because they will set an input for the ngForTrackBy and alter the behavior of the renderer, but how I can test it? any suggestion?

nartc added a commit that referenced this issue Sep 18, 2023
* [feat] add trackById trackByProp + tests + docs

* [docs] fix call-apply docs + ref utilities README

* test(track-id-prop): add e2e test

* feat(track-id-prop) renaming directives

* feat(track-id-prop) shorter name for directives

---------

Co-authored-by: Chau Tran <nartc7789@gmail.com>
@nartc nartc closed this as completed Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants