Component *change events consistency
See original GitHub issueBug, feature request, or proposal:
Proposal.
What is the expected behavior?
I’d expect all components to have the same behavior. Or all return a plain object, or all return an instance of a class
.
What is the current behavior?
Some components return a plain object, others return an instance of a class
.
What components have a different behavior?
Topic 1 (About emit a plain object):
Topic 2 (Some “change” events are named ...Event
, some others are ...Change
and others are ...ChangeEvent
):
https://github.com/angular/material2/blob/5210b3e197647381611ec48ddcd99333ec5356e9/src/lib/autocomplete/autocomplete.ts#L35
Suffixed by ‘Event’.
https://github.com/angular/material2/blob/5210b3e197647381611ec48ddcd99333ec5356e9/src/lib/tabs/tab-group.ts#L43 This is the only event that is suffixed by ‘Change’ and ‘Event’.
https://github.com/angular/material2/blob/5210b3e197647381611ec48ddcd99333ec5356e9/src/lib/chips/chip.ts#L25 Besides being an interface (not a class), it isn’t suffixed by ‘Change’.
https://github.com/angular/material2/blob/5210b3e197647381611ec48ddcd99333ec5356e9/src/lib/chips/chip-input.ts#L16 Not sure about this. I think this can’t be considered inconsistency, but I’ll left it here anyway.
https://github.com/angular/material2/blob/5210b3e197647381611ec48ddcd99333ec5356e9/src/lib/paginator/paginator.ts#L30 Suffixed by ‘Event’.
https://github.com/angular/material2/blob/5210b3e197647381611ec48ddcd99333ec5356e9/src/lib/sort/sort.ts#L41 Besides being an interface (not a class), it isn’t suffixed by ‘Change’.
Is there anything else we should know?
Maybe it’s a complement of #6677.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
Vivian had been the one owning this project, but she left the team a long while ago, and it basically fell to the wayside when that happened. With everything else we’ve got going on now, I don’t think this will be on our radar in 2020.
Hey @amcdnl, as I said it’s a complement of #6677.
There are inconsistencies here that aren’t pointed out in that issue.
And, according to your last comment there you’ve already done all the work for that issue.