title: How to use checkboxes for creating an array-list of related objects in angularjs
body: <p>I have a given array of objects, whose objects I would like to add to a 'selected'-list depending on  related checkboxes. How could I set them up without having to set up the controller to much.</p>
  
  <p>Here is the fiddle which works fine, when using radio-boxes instead: 
  <a href="http://jsfiddle.net/JohannesJo/6ru2R/" rel="nofollow">http://jsfiddle.net/JohannesJo/6ru2R/</a></p>
  
  <p><strong>JavaScript:</strong></p>
  
  <pre><code>app = angular.module('app',[]);
  
  app.controller('controller', function($scope){
  $scope.aData = [
      {i:1},
      {i:2}
  ];
  $scope.aSelected = [];
  });
  </code></pre>
  
  <p><strong>html:</strong></p>
  
  <pre><code>&lt;body ng-app="app"&gt;
          &lt;div ng-controller='controller'&gt;
              &lt;input type = "checkbox" ng-model = "aSelected"  value = "{{aData[0]}}"&gt;
              &lt;input type = "checkbox" ng-model = "aSelected"  value = "{{aData[1]}}"&gt;
  
              &lt;div&gt;test:     {{oSelected}}&lt;/div&gt;
           &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>