title: Angular 2 + how to select and loop over multiple elements with the same selector (elementRef.nativeElement)
body: <p>In my component I am trying to unselect all checkboxes with the same class name.</p>
  
  <p><code>querySelector</code> selects only the first one each time (or once)... and <code>querySelectorAll</code> does not select anything.</p>
  
  <p>this is the function. I know its wrong to use jQuery like that but it illustrates my goal.</p>
  
  <pre><code>unsetAllOptions(){
      var self = this;
      var i = 0;
      $("input.option_input").each(function(){
          i++;
          var element = self.elRef.nativeElement.querySelector("input.option_input")[i];
          if(element.checked){
              // console.log(i)
              console.log('unchecking:',i);
              element.checked=false;
              element.dispatchEvent(new Event('change'));
              element = "";
          }
      });
  }
  </code></pre>