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

Document options passing in ES7 property decorators #155

Closed
jwahyoung opened this issue Sep 28, 2015 · 1 comment
Closed

Document options passing in ES7 property decorators #155

jwahyoung opened this issue Sep 28, 2015 · 1 comment

Comments

@jwahyoung
Copy link

In the Custom Attribute documentation, it's mentioned that you can pass options to @bindable in the ES6 class decorators, like so:

@bindable({
  name:'myProperty', //name of the property on the class
  attribute:'my-property', //name of the attribute in HTML
  changeHandler:'myPropertyChanged', //name of the method to invoke when the property changes
  defaultBindingMode: bindingMode.oneWay, //default binding mode used with the .bind command
  defaultValue: undefined //default value of the property, if not bound or set in HTML
})

The ES7 property decorators negate the need for the name property, but it's not explicitly stated that you can do this, which seems to work:

@bindable({ attribute:'my-property', changeHandler:'myPropertyChanged', defaultBindingMode: bindingMode.oneWay, defaultValue: undefined }) name;

It might be worthwhile to add an explicit example of this.

@EisenbergEffect
Copy link
Contributor

Made a note of it here: #181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants