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

Event Properties Consistency #4207

Closed
tbragaf opened this issue Sep 16, 2015 · 3 comments
Closed

Event Properties Consistency #4207

tbragaf opened this issue Sep 16, 2015 · 3 comments

Comments

@tbragaf
Copy link

tbragaf commented Sep 16, 2015

Hi everyone!

Properties and Events have different alias behaviour.

If I want to alias a property with hyphens I use:

properties: ['selectedValue: selected-value'],

But If I want to alias an event with hypens:

events: ['valueUpdate: selected-value'] // this won't work... 
//events: ['valueUpdate: selectedValue'] // this works
And then I can use (selected-value)="event"

Working plnkr: http://plnkr.co/edit/TnUqxetDhbgcO1ZEX63U?p=preview

Best regards,
Tiago Braga

@mhevery
Copy link
Contributor

mhevery commented Sep 29, 2015

This works as intended, even thought it is confusing. That is because <div (selected-value)="..."> binds to what event? Because we don't have casing in HTML, we have to assume that it binds to selectedValue event since that is the convention we use for converting skewer-case to camelCase. Therefore ['valueUpdate: selectedValue'] is correct.

@mhevery mhevery closed this as completed Sep 29, 2015
@tbragaf
Copy link
Author

tbragaf commented Sep 29, 2015

I understand it is correct. It is about consistency.
I just think that an alias to a property should be similar to an event.
An alias works as an outside way to use a property.

In property aliases we use the hyphens and works.
Not the case with events. We need the alias to be camel case.

As I understood:

<property/event> : <alias to use from the outside>

@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants