is there an easy way to get access to a component from anywhere?

41 views
Skip to first unread message

neo....@financialogixgroup.com

unread,
Oct 10, 2014, 11:29:24 AM10/10/14
to polym...@googlegroups.com
right now i'm doing something like this:

        function getChartPages() { 
              return document.querySelector("dashboard").shadowRoot.querySelector("#panelA").shadowRoot.querySelector("#panelA3").shadowRoot.querySelector("#panelA3south"); 
        }

i wonder if there's an easy way to achieve the same thing...

Rob Dodson

unread,
Oct 10, 2014, 4:03:12 PM10/10/14
to neo....@financialogixgroup.com, polymer-dev
is "dashboard" supposed to be a class or id?

to select something deeply nested in the shadow DOM you can use the /deep/ combinator

document.querySelector('x-foo /deep/ #someThing');


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/06dbdd29-4aaf-4c18-9a0c-cc9632c4dafd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages