-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Make all @Output names, property names, and event class names consistent #6677
Comments
Here is my initial audit and proposals before I make any changes.
Chip
Date Picker
Menu
Paginator
Select
Sidenav
Sort
Tabs
@jelbourn - do we want to convert |
@Output('mdSortChanged')
changed = new EventEmitter<Whatever>(); cc @angular/angular-material since this affects everything If we move forward with this, it would be good to do one PR per component; this will make it easier to get the changed into Google. For the more widely-used components, we'll probably need a window of backwards compatibility. |
For datepicker, Also |
We should mark those two with an I'd be okay with |
A note on the |
On @crisbeto point, the 2 way binding relies on the input names having a suffix of |
Yeah, if an event is only used by us (not meant to be a public API), then it should start with an underscore. For the event class names, I'd think they should all be something like In places where we add an output only for two-way binding, can we still get away with marking those as internal (underscore property name, |
Are we good to move forward? @jelbourn - Do you want these in distinct PRs for each component? Should I support backwards compatibility? |
+1 to |
Maybe saying always past-tense is overboard. How about Chip
Date Picker
Menu
Paginator
Select
Sidenav
Sort
Tabs
So every |
My thoughts from the suggestions: Chip
Date Picker
Paginator
Select
Sidenav
Sort
OverallI feel like using
If we take the approach for naming actions to past tense it differs in tense from the rule |
We don't necessarily follow the Angular style guide- there's some stuff that I disagree with in there anyway.
|
|
|
I feel like |
@mmalerba how would you otherwise deal with We could do something like @Input() opened: boolean;
@Output() openChange = new EventEmitter<...>();
@Output('opened') get _openChangeOut() {
return filter.call(this.openChange, c => c.opened);
}
@Output('closed') get _openChangeOut() {
return filter.call(this.openChange, c => !c.opened);
} |
@jelbourn - I've submitted all PRs for this. |
Ah I see, I didn't realize you were trying to get 2-way binding to work. Ok in that case either |
Related: |
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. |
No description provided.
The text was updated successfully, but these errors were encountered: