title: AngularJS checkbox issue
body: <p>I'm quite new to angularjs and I'm working on an app. I'm having problems with a checkbox. Selecting the checkboxes outputs the correct array elements, but the problem is when I unselect them. The elements just add themselves back into the array. Sorry if I'm not explaining myself... I think what needs to happen is to remove the selected checkbox from array if it's unchecked. Have I missed a loop somewhere or would I need add a $watch?. I've been trying to solve this for hours now! 
  Any suggestions/help would be greatly appreciated. Thank you.</p>
  
  <pre><code>Here is the code:
  
  HTML: This is the select/unselect on table header.
  
   &lt;td class="checkbox-selector"&gt;
                                  Select All
                                  &lt;input type="checkbox"  
                                         ng-model="selectedAll" 
                                         ng-click="checkAll()"&gt;
                              &lt;/td&gt;
  
      ..and the individual checkboxes:
  
  
  
  &lt;td&gt;
                              &lt;input type="checkbox" 
                                     class="checkbox-row"
                                     ng-model="result.isSelected"
                                     ng-click="selectedShop(result.shopName, result.ItemId)" /&gt;
                              &lt;/td&gt;
  
  Angularjs:
  
   $scope.allSelection = [];
  
      $scope.checkAll = function() {
          if ($scope.selectedAll) {
              $scope.selectedAll = false;
          } else {
              $scope.selectedAll = true;
          }       
          angular.forEach($scope.results, function (result) {  
              result.isSelected = $scope.selectedAll;  
              $scope.allSelection.push("result.shopName"+"result.itemId");        
  
              $scope.allSelection=[];
  
          });
      };
  
  
  $scope.selection=[];
  
  $scope.selectedShop = function selectedShop(shopName, itemId) {
       $scope.selection.push("shopName"+ "itemId");
  
  };
  </code></pre>