user3240644
user3240644

Reputation: 2281

Polymer 2.0 $$() does not work

In Polymer 1.x where this.$$('some selector') was working, what is the equivalent in Polymer 2.0 since this.$$() doesnt work anymore?

Thanks.

Upvotes: 1

Views: 168

Answers (1)

a1626
a1626

Reputation: 2964

$$ is deprecated in Polymer 2.x instead you'll have to use something like

this.shadowRoot.querySelector

If you really want to use $$ you can use it from LegacyMixin which has all the deprecated methods. As LegacyMixin internally extends Polymer.Element you only need to extend LegacyMixin.

class MyElement extends  Polymer.LegacyElement 

Upvotes: 1

Related Questions