title: jQuery selection in polymer webcomponent
body: <p>Well, out of the box, jQuery does not have support for selecting nodes inside webcomponent(s). (probably because <code>document.querySelector()</code> does not work for shadow DOM (nor it should, by definition)).</p>
  
  <p>Our previous codebase was somewhat dependent on jQuery and many of the devs do not want to let go of the simplicity of <code>$(...)</code> selection. So, I wrapped up this quick and dirty trick.</p>
  
  <pre><code>window.$$ = function (that, selector) {
      return $(that.shadowRoot.querySelectorAll(selector));
  }
  </code></pre>
  
  <p>Usage (inside a lifetime callback or whenever the <code>host</code> node can be accessed):</p>
  
  <pre><code>jqel = $$(this, '.myClass'); // this has reference to the host
  </code></pre>
  
  <p>The question is, is there a better way to go about this?</p>