Closed dragoscirjan closed 7 years ago
@bindable({
name:'offeringsUrl',
attribute:'offerings-url',
changeHandler:'offeringsUrlChanged',
defaultBindingMode: bindingMode.oneWay,
defaultValue: {}
})
export class Foo {
@bindable pcProductView = 'grid';
}
When using the bindable
decorator and passing the name
property, you decorate the class. This tells Aurelia to add a bindable property to the class. As you have seen, if you use the bindable
decorator inside the class, it will receive as its target the class property that comes next. So use the syntax I show above when you want to specify the name in the options to the decorator.
The first usage you posted isn't a valid use of the bindable
decorator, so this isn't a bug in babel or Aurelia.
I do not know if this is a babel bug or an Aurelia one, so I submitted it to both projects (babel#4887).
Input Code
Babel Configuration (.babelrc, package.json, cli command)
We're using the default Aurelia Skeleton configuration.
Expected Behavior
Should have both variables working.
Current Behavior
Defining an "annotated" variable as
@bindable({object})
before another "annodated" variable as@bindable name = 'defaultValue'
will cause the second variable to be attributed to the first one.Your Environment