Can on-$(event) attrs be used outside of Shadow DOM?

67 views
Skip to first unread message

Marco Scannadinari

unread,
Aug 6, 2014, 3:35:47 PM8/6/14
to polym...@googlegroups.com
Judging by this link it looks like it can't, but if so, then what is the use of the double-moustache syntax if it is bound to that scope anyway? i.e. what other scope could on-tap access apart from the element prototype defined in Polymer("foo", { THIS BIT })?

Thanks

Daniel Freedman

unread,
Aug 7, 2014, 1:44:13 PM8/7/14
to Marco Scannadinari, polymer-dev
It's a bit more subtle than that. The binding syntax can only be used inside of bound <template> elements. To be "bound", a <template> needs a the model property to be set, and to have the correct "bind" attribute set: http://www.polymer-project.org/docs/polymer/binding-types.html, or be inside an already bound template.

Polymer provides an "auto-binding" template that we use extensively for element demos: https://github.com/Polymer/core-icons/blob/master/demo.html#L79-L93

The template binding magic is done automatically to the <template> inside of <polymer-element>.


On Wed, Aug 6, 2014 at 12:35 PM, Marco Scannadinari <m...@scannadinari.co.uk> wrote:
Judging by this link it looks like it can't, but if so, then what is the use of the double-moustache syntax if it is bound to that scope anyway? i.e. what other scope could on-tap access apart from the element prototype defined in Polymer("foo", { THIS BIT })?

Thanks

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 polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/3650743a-81c0-4512-952b-4f0447e9337e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages