title: Calculate summary with AngularJs on selected checkboxes
body: <p>I'm learning the AngularJs and I've created a dynamic list with <code>ng-repeat</code>, but now I cannot find the solution for the next step...</p>
  
  <p>I have the following code:</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div ng-app="app"&gt;
      &lt;div class="list" ng-controller="ListController"&gt;
  
          &lt;div class="row" ng-repeat="prod in prodList"&gt;
              &lt;div class="prod-name cell"&gt;
                  &lt;input type="checkbox" id="prod-{{ prod.id }}" data-ng-model="orders.prods.prod[prod.id]" value="{{ prod.id }}" data-cb="" /&gt;&lt;label for="prod-{{ prod.id }}"&gt;{{ prod.name }}&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="prod-size cell"&gt;
                  &lt;label for="prodColor-@{{ prod.id }}"&gt;
                      &lt;select id="prodColor-{{ prod.id }}" data-ng-model="orders.prods.color[prod.id]" data-ng-options="color.id as color.name for color in prod.colors"&gt;
                          &lt;option value=""&gt;Select one&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="prod-price cell"&gt;
                  {{ prod.price }}
              &lt;/div&gt;
  
          &lt;/div&gt;
  
          &lt;div class="sum"&gt;
              {{ sum }}
          &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>var app = angular.module("app", [], function () {
  });
  
  app.controller('ListController', function ($scope) {
      init();
  
      function init () {
          $scope.prodList = [{"id":"1","name":"window","colors":[{"id":"9","name":"white"},{"id":"11","name":"black"}],"price":"100"},{"id":"2","name":"door","colors":[{"id":"22","name":"blue"},{"id":"23","name":"red"}],"price":"356"},{"id":"3","name":"table","colors":[{"id":"37","name":"white"},{"id":"51","name":"black"}],"price":"505"}];
          $scope.orders = {};
          $scope.orders.prods = {};
          $scope.orders.prods.prod = {};
          $scope.orders.prods.color = {};
          $scope.sum = 0;
      }
  });
  </code></pre>
  
  <p><strong>Working demo:</strong></p>
  
  <p><a href="http://jsfiddle.net/HDrzR/" rel="nofollow">http://jsfiddle.net/HDrzR/</a></p>
  
  <p><strong>Question</strong></p>
  
  <p>How can I calculate the summary of selected product's price into the <code>$scope.sum</code>? </p>
  
  <p><em>Edited:</em></p>
  
  <p>So if you select the "window" and the "table" from the list, the sum should contains 606. But if you unselect the "table" then the sum should be 100.</p>
  
  <p>Thank you in advance!</p>