On Thu, Dec 4, 2014 at 4:53 AM, <[email protected]> wrote:
> In the Polymer docs I see this pattern for adding event listeners to
> app-level elements... however this seems to break with the "everything is a
> component" idea.
> Does it make sense to treat the main app element (child of body) as it's
> own Custom element and then encapsulate the event listeners via normal
> Polymer conventions using `Polymer` constructor?
>
The examples in the docs show examples of using elements outside of
polymer-element and inside of it. For this particular example, users of
paper-tabs don't have to know anything about Polymer to use it. They just
attached listeners and set properties like any other element.
For more power, we often create higher level app components because on-*
handlers and data-binding features are darn convenient! Also saves a bit of
boilerplate and typing.
All that said, create components where it makes sense for you.
> <script>var tabs = document.querySelector('paper-tabs');var list =
> document.querySelector('post-list');
>
> tabs.addEventListener('core-select', function() {
> list.show = tabs.selected;
> });</script>
>
> 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/84ebb061-21cc-4075-9f85-af8493519fdd%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/84ebb061-21cc-4075-9f85-af8493519fdd%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/CACGqRCD6kAPiF3G6X12_3TuQVrBf56YGEfq1ThcrSxpV8B3%3DxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.