In the latest polymer release, we've made reflection of property values to
attribute values opt-in. We've done this mainly as a performance
optimization. Published properties maintain their other previous behaviors:
they are bound as properties and corresponding attribute values are
deserialized and set to property values.

To cause a property to reflect to an attribute, use the publish block and
set a property value that's an object literal with a value property
specifying the property's default value and a reflect property with the
value set to true. Here's an example:

publish: {
  // won't reflect to an attribute
  bigText: '',
  // will reflect to an attribute
  active: {value: false, reflect: true}
}

Here's some more information:

Typically it's important to reflect to attributes only properties that will
be used for styling. Previously Polymer did this for all published
properties, and this led to unnecessary work. Additionally, there are some
properties that simply don't make sense to reflect to attributes. In the
example above, if the bigText property was set to a 10k character string,
we really would not want to reflect that to an attribute. This is why we've
decided to make property reflection to attributes opt-in.

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CA%2BrMWZh-MpWnaEML3kZ5Fyojo6H_d3HTAeEF%3DpoRgpW3vWYD4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to