>From the 
>docs<http://www.polymer-project.org/polymer.html#default-property-values>,
when to use "attributes" vs. "published":

Generally it's preferable to use the attributes attribute because it's the
declarative approach and you can easily see all of the exposed properties
at the top of the element.

You should opt for the publish property when either of the following is
true:

   1. Your element has many properties and placing them all on one line
   feels unwieldy.
   2. You want to define default values for properties and prefer the
   DRYness of doing it all in one place.



On Tue, Feb 18, 2014 at 12:37 PM, John Messerly <[email protected]>wrote:

> On Sun, Feb 16, 2014 at 1:52 PM, Sergey Shevchenko <[email protected]>wrote:
>
>>
>> I'm not sure what weight Polymer Dart has on general Polymer JS
>> development, but I think it needs to be mentioned that in Polymer Dart, the
>> attributes property's purpose has already shifted towards
>> documenting/code validity checking: it is always required that a published
>> property be defined in the element's Dart implementation [...]
>>
>
> Hmm, if true that would be a bug in Polymer.dart :). The "attributes"
> attribute and "publish"-ing a property do the same thing but they operate
> independently. Saying attributes="foo" should be enough to cause the
> attribute "foo" to correspond with "foo" in your custom element. You don't
> also need to publish it.
>
> It is true (for now) that if you want changes to propagate in the other
> direction (property -> attribute) you need to mark the field with
> @observable, but that's more a limitation in how observers work in Dart
> (and one I hope we can fix).
>
> FWIW, I do agree that it is a bit confusing to have "publish" and
> "attributes". If I recall correctly, "attributes" is preferred because it's
> easier for tools to understand. But I'm not sure in what cases "publish"
> would be recommended.
>
>  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/CAJup4OX%2Bayp-dYtBG-8zzvD%3DAa8WAQOGBRcnnjRy27Tm9Spi1A%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

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/CACGqRCCgA2gSub44o9vk2dU4U9kuFL2hmY24pqgFySudB5zHRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to