title: How to get the checkbox value in angular.js
body: <p>I have been searching the threads here but can't really find the answer.</p>
  
  <p>I am trying to get the value for the checked boxes when user check them in Angular. I have something like</p>
  
  <pre><code>&lt;div class="checkbox"&gt;
  
  &lt;div class="checkbox" ng-repeat="product in products"&gt;
      &lt;input type="checkbox" ng-model="product"/&gt; {{product.name}}
  &lt;/div&gt;
  
  &lt;button ng-click='add()'&gt;&lt;/button&gt;
  </code></pre>
  
  <p>I want to have something in my js like</p>
  
  <pre><code>$scope.add = function() {
      //I want to add the checked product in the selectedProduct array
      $scope.selectedProduct = ['product1', 'product2', 'product4']  =&gt; the selected products.
  }
  </code></pre>
  
  <p>How do I do this? Thanks!</p>