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
Polymer augments basic mdv attribute binding behavior by allowing 'published' properties to be bound directly to model values. This provides a form of 2-way binding and removes the restriction that bound data be string valued.
The notion is that these attribute values are used only for initialization purposes (similar to input's value attribute) and that developers should be programmatically interacting with properties and not attributes.
There are some times a developer wants to reflect property values back to attributes; for example, for styling based on attribute selectors or to interact with other libraries/elements that expect changes to attributes.
- attributes are now reflected to property values at runtime, not only at create time. The rules are the same, the attribute is deserialized to the data type of the property in the element's prototype.
- `published` properties are now reflected to attributes at runtime. This is done via observation and all published properties are now observed. Properties are serialized directly to strings and object and undefined valued
properties are ignored.
Polymer augments basic mdv attribute binding behavior by allowing 'published' properties to be bound directly to model values. This provides a form of 2-way binding and removes the restriction that bound data be string valued.
Polymer does not currently reflect bound property values back to attribute values and this is a source of potential confusion. For background, see: https://groups.google.com/forum/#!searchin/polymer-dev/attributes/polymer-dev/S1jqJppSNCs/GztkRpykOnAJ.
The notion is that these attribute values are used only for initialization purposes (similar to input's value attribute) and that developers should be programmatically interacting with properties and not attributes.
There are some times a developer wants to reflect property values back to attributes; for example, for styling based on attribute selectors or to interact with other libraries/elements that expect changes to attributes.
cc @ebidel
The text was updated successfully, but these errors were encountered: