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(core): KeyValueDiffer support for NgForOf #21990

Closed
skreborn opened this issue Feb 2, 2018 · 3 comments
Closed

feat(core): KeyValueDiffer support for NgForOf #21990

skreborn opened this issue Feb 2, 2018 · 3 comments

Comments

@skreborn
Copy link
Contributor

skreborn commented Feb 2, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request

Current behavior

NgForOf only supports IterableDiffer.

Expected behavior

NgForOf should support KeyValueDiffer by default, making ES6 Maps easily iterable using ngFor.

What is the motivation / use case for changing the behavior?

Iteration of an ES6 Map is currently possible by caching Map.entries() every time a change is detected manually within ngDoCheck (using our own injected KeyValueDiffer), and iterating through that. The caching is required because Map.entries() returns a different value on each call, making Angular's default change detection go crazy.

While this isn't a problem that's impossible to work around, it's certainly inconvenient, and a built-in way to tackle this would be much appreciated. Then again, if you believe that this change would introduce too much complexity to a core directive, and the trade is simply not worth it, please feel free to close the issue.

@chuckjaz
Copy link
Contributor

chuckjaz commented Feb 2, 2018

Thanks for reporting this issue. However this issue is a duplicate of an existing issue #2246. Please subscribe to that issue for future updates.

@chuckjaz chuckjaz closed this as completed Feb 2, 2018
@skreborn
Copy link
Contributor Author

skreborn commented Feb 3, 2018

Sorry about that, my mistake. Don't know how I missed that.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
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