Hi Michael,

You can add default attributes by including them on the <polymer-element>
definition. Any custom attrs will be included on an instance of the element:

http://www.polymer-project.org/docs/polymer/polymer.html#defaultattrs

On Fri, Sep 12, 2014 at 11:34 AM, Michael Bleigh <[email protected]> wrote:

> Is there any way to reliably attach attribute-based behavior to custom
> elements by default? There are two cases I'm thinking of:
>
>    1. Wanting to have a host element automatically apply layout
>    attributes to itself
>    2. Wanting to add touch-action on a host element by default
>
> In the former case, I know that I can do the CSS manually (but it'd be
> nice not to have to) but I'm not sure how to accomplish the latter case
> short of actually adding the attribute during the created callback, but
> that pollutes the DOM a bit. I'm working around it for now by having an
> inner container, but I'd prefer not to have to do that.
>
> Any "right way" to do this?
>
> 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/e748660c-32fb-4bd1-99af-c27c886176e3%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/e748660c-32fb-4bd1-99af-c27c886176e3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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/CACGqRCCo%2Bz%3DRjZ5q6rhgiSm%3DcXTXCSweqYOPU5ct8XPFXdM_2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to