title: select all checkboxes inside ng-repeat
body: <p>Am having a list of check boxes in ng-repeat as:</p>
  
  <pre><code>  &lt;div ng-repeat="item in results"&gt;
        &lt;label class="inlinelabel checkbox"&gt;
          &lt;input type="checkbox" ng-model="selected[item.id]"&gt;&lt;i&gt;&lt;/i&gt;
        &lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I would like to select all checkboxes on click of a single check box that is outside the ng-repeat.</p>
  
  <pre><code>   &lt;label&gt; Select All &lt;/label&gt;
  &lt;input type="checkbox" data-ng-model="selectedAll" ng-click="checkAll()"&gt;
  </code></pre>
  
  <p>I tried the code in controller but its not working.  </p>
  
  <pre><code>   $scope.checkAll=()=&gt;{
                  if ($scope.selectedAll) {
                      $scope.selectedAll = true;
                  } else {
                      $scope.selectedAll = false;
                  }
                  angular.forEach($scope.employees,function (selected) {
                      selected[selected.id] = $scope.selectedAll;
                  });
              }
  </code></pre>