Abfragen von Selector-Elementen im DOM eines Elements mit Polymer
Ich habe mein Element:
<dom-module id="x-el">
<p class="special-paragraph">first paragraph</p>
<content></content>
</dom-module>
und ich benutze es wie
<x-el>
<p class="special-paragraph">second paragraph</p>
</x-el>
in meinem zwingenden Teil:
Polymer({
is: 'x-el',
ready: function () {
/* this will select all .special-paragraph in the light DOM
e.g. 'second paragraph' */
Polymer.dom(this).querySelectorAll('.special-paragraph');
/* this will select all .special-paragraph in the local DOM
e.g. 'first paragraph' */
Polymer.dom(this.root).querySelectorAll('.special-paragraph');
/* how can I select all .special-paragraph in both light DOM and
local DOM ? */
}
});
,
Ist es möglich, dies mit eingebauten Polymeren zu tun? Oder sollte ich die Standard-DOM-API verwenden?