title: Get checkbox name, value and checked state in Angular
body: <p>I have the following 4 checkboxes, generated dynamically. In the angular component, I would like to retrieve the "name", "value" and "state" of the checkbox.</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;input type="checkbox" 
         name="automotive" 
         value="car" 
         ngModel 
         (ngModelChange)="filterResults(obj, $event)"&gt;
  
  &lt;input type="checkbox" 
         name="automotive" 
         value="truck" 
         ngModel 
         (ngModelChange)="filterResults(obj, $event)"&gt;
  
  &lt;input type="checkbox" 
         name="apparel" 
         value="shirts" 
         ngModel 
         (ngModelChange)="filterResults(obj, $event)"&gt;
  
  &lt;input type="checkbox" 
         name="apparel" 
         value="pants" 
         ngModel 
         (ngModelChange)="filterResults(obj, $event)"&gt;
  </code></pre>
  
  <p><strong>Component:</strong></p>
  
  <pre><code>filterResults(obj: any, isChecked: boolean){
    console.log(obj);
    console.log(isChecked); // {}, true || false
  } 
  </code></pre>
  
  <p>I am able to get the state of the checkbox, but not the name and value. Upon printing to the console, <code>obj</code> is undefined. I would like to apply filters to a dataset based on the name and value of the checkbox. </p>
  
  <p>How do I get the name and value of the checked checkboxes, so I can do that?</p>