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
@bindable's defaultBindingMode property don't work. #73
Comments
The syntax has changed, now it's |
@jods4 you have to import |
I know and I did (I am using TypeScript so that would have been an error otherwise). Does it work for you now? I have a customAttribute with bindable properties, like so: export class SomethingCustomAttribute {
@bindable({ defaultBindingMode: bindingMode.twoWay })
public x: string = null;
} But when I use it so: |
Ok, I think this is a confusion about how to use custom attributes. A simple custom attribute that wants two-way binding to be the default should be declared like this: @customAttribute('my-attr', bindingMode.twoWay)
export class MyAttr {
valueChanged(newValue, oldValue) {
//do stuff
}
} For simple attributes, you don't define the properties, the framework provides on automatically...and so the binding mode need to be declared on the class. You only declare it on properties if you have an attribute that maps to multiple properties (an options attr). |
@EisenbergEffect I am not sure I understand fully. As my example shows, I'm trying to have an options attribute. I only used Something more like this (just an example, mind you): In this case |
Ok, I may have misunderstood. I'll re-open this and investigate further. |
If you specify a default binding mode in
@bindable
decorator It will not be used when you bind you attribute throught.bind
.if my-attribute is defined as
foo will not be updated.... but if you use:
then foo will be updated as expected.
I'll make a repro on top of skeleton-nav later...
The text was updated successfully, but these errors were encountered: