this.$ vs. this.shadowRoot.querySelector #2321
Comments
@justinfagnani PTAL. |
@FluorescentHallucinogen yes, And if you choose to use For class-style elements, we explicitly recommend |
@arthurevans Are there any plans to deprecate |
@FluorescentHallucinogen That would be quite disappointing if so, as it is a very useful shortcut which allows you to not have to save a reference to every node in |
Not changing any recommendations here, so closing. |
this.shadowRoot.querySelector
is a native Shadow DOM API method, whilethis.$
is a Polymer API object.this.shadowRoot.querySelector
can access nodes created dynamically using data binding (including those indom-repeat
anddom-if
templates), whilethis.$
can't.So why not to use
this.shadowRoot.querySelector
instead ofthis.$
always everywhere?The text was updated successfully, but these errors were encountered: