Angular checkboxes example

by tchatel

HTML

<script src="http://docs-next.angularjs.org/angular-0.10.5.min.js" ng:autobind></script> 
<script>
  function MyCntrl(){
    var scope = this;
    scope.values = [];
    scope.colors = [
      {name:'black', shade:'dark'},
      {name:'white', shade:'light'},
      {name:'red', shade:'dark'},
      {name:'blue', shade:'dark'},
      {name:'yellow', shade:'light'}
    ];
}
</script>
<div ng:controller="MyCntrl">
<ul>
    <li ng:repeat="color in colors">
        {{color.name}}
        <input type="checkbox" ng:model="values[color.name]" value="color.shade">
    </li>
</ul>
Values:
{{values}}
</div>