You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is intentional or not, so I'm filing it as an issue.
In 0.5, only properties explicitly exposed via attributes or publish were available for data binding from the outside (that is, binding to property1 using an attribute like property1="{{someThing}}").
This is as designed. It results from a fundamental difference between how data binding worked in 0.5 vs. 0.8.
In 0.5, the TemplateBinding lib used Node.bind which is called by the source of the binding on the target of the binding at instance time and gives it an Observable object. When the value of the property in the source changes, the node at the target of the binding is notified via the Observable and allowed to do what it will with the new value bound to the given name.
In 0.8, binding associations are recorded in the source element of the binding at declaration time. When the value of the property in the source changes, it simply sets the property of the given name on the target element. So control is inverted such that the source pokes the value into the target, rather than the target being notified by the source and poking itself (or skipping any property assignment altogether, as in unpublished 0.5 properties).
The 0.8 implementation is a great simplifying factor in that there is no instance-time cost (binding side-effects are baked into the element prototype once at declaration time) and avoids any heavy machinery for notification; a limitation is that the target of the binding has no ability to "reject" the assignment, other than to declare a property read-only.
There are possible ways to avoid binding to non-public values at declaration time with added cost/complexity. This could be added to a "debug mode" or "strict mode" in the future.
Not sure if this is intentional or not, so I'm filing it as an issue.
In 0.5, only properties explicitly exposed via
attributes
orpublish
were available for data binding from the outside (that is, binding toproperty1
using an attribute likeproperty1="{{someThing}}"
).0.5, can't bind to an unpublished property:
http://jsbin.com/tumaxi/3/edit
In 0.8, you appear to be able to bind to any property, whether or not it's in the
properties
object:http://jsbin.com/muvozu/2/edit
Is this a bug or a feature? I could go either way, so seeking clarification.
The text was updated successfully, but these errors were encountered: