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

Allow ReadonlyMap with keyvalue pipe #37308

Closed
tguichaoua opened this issue May 27, 2020 · 2 comments
Closed

Allow ReadonlyMap with keyvalue pipe #37308

tguichaoua opened this issue May 27, 2020 · 2 comments
Labels
area: common Issues related to APIs in the @angular/common package cross-cutting: types feature Issue that requests a new feature state: confirmed
Milestone

Comments

@tguichaoua
Copy link

🚀 feature request

Relevant Package

This feature request is for @angular/core

Description

The keyvalue pipe accept as input Map<K, V> but not ReadonlyMap<K, V>.
I don't know how exactly work the pipe, but I don't think the pipe need to change the input value.

Describe the solution you'd like

It's possible to replace Map<K, V> by ReadonlyMap<K, V> in the KeyValuePipe.transform signature without break the backward compatibility.

Describe alternatives you've considered

It's possible to add a property to the component and make a cast. But this solution don't seems proper.

@pkozlowski-opensource pkozlowski-opensource added area: common Issues related to APIs in the @angular/common package cross-cutting: types labels May 27, 2020
@ngbot ngbot bot modified the milestone: needsTriage May 27, 2020
@petebacondarwin
Copy link
Member

This seems like a very reasonable request - and probably one that we should apply to other pipes that do not modify their value. Also it would not be a breaking change IMO - so perhaps we could do it in 10.1? @IgorMinar ??

ajitsinghkaler added a commit to ajitsinghkaler/angular that referenced this issue May 27, 2020
ReadonlyMap is a superset of Map, in keyValuePipe we do not change the value of the object so ReadonlyPipe Works right in this case and we can accomodate more types. To accomodate more types added ReadonlyMap in Key Value pipe.

Fixes angular#37308
@AndrewKushnir AndrewKushnir added the feature Issue that requests a new feature label May 27, 2020
@ngbot ngbot bot modified the milestones: needsTriage, Backlog May 27, 2020
ajitsinghkaler added a commit to ajitsinghkaler/angular that referenced this issue May 27, 2020
ReadonlyMap is a superset of Map, in keyValuePipe we do not change the value of the object so ReadonlyPipe Works right in this case and we can accomodate more types. To accomodate more types added ReadonlyMap in Key Value pipe.

Fixes angular#37308
ajitsinghkaler added a commit to ajitsinghkaler/angular that referenced this issue May 28, 2020
ReadonlyMap is a superset of Map, in keyValuePipe we do not change the value of the object so ReadonlyPipe Works right in this case and we can accomodate more types. To accomodate more types added ReadonlyMap in Key Value pipe.

Fixes angular#37308
@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 Aug 20, 2020
profanis pushed a commit to profanis/angular that referenced this issue Sep 5, 2020
…r#37311)

ReadonlyMap is a superset of Map, in keyValuePipe we do not change the value of the object so ReadonlyPipe Works right in this case and we can accomodate more types. To accomodate more types added ReadonlyMap in Key Value pipe.

Fixes angular#37308

PR Close angular#37311
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: common Issues related to APIs in the @angular/common package cross-cutting: types feature Issue that requests a new feature state: confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants