title: Populate an input when checkbox is checked from ngRepeat
body: <p>I'm trying to populate an input two ways. The first method is to simply type an amount into the input, which works perfectly. The second method (which I'm struggling with) is to check the checkbox generated within the ngRepeat directive. </p>
  
  <p>The desired behavior is that the checkbox will take the value of item.amount from the JSON data and populate the input with that value. Here is the markup:</p>
  
  <pre><code>&lt;table class="table table-striped header-fixed" id="invoiceTable"&gt;
      &lt;thead&gt;
        &lt;tr&gt;
          &lt;th class="first-cell"&gt;Select&lt;/th&gt;
          &lt;th class="inv-res2"&gt;Invoice #&lt;/th&gt;
          &lt;th class="inv-res3"&gt;Bill Date&lt;/th&gt;
          &lt;th class="inv-res4"&gt;Amount&lt;/th&gt;
          &lt;th class="inv-res5"&gt;Amount to Pay&lt;/th&gt;
          &lt;th class="inv-res6"&gt;&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
        &lt;tr ng-if="invoices.length" ng-repeat="item in invoices | filter: {status:'Unpaid'}"&gt;
          &lt;td class="first-cell"&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt;
          &lt;td class="inv-res2"&gt;&lt;a href="invoices/{{item.invoiceNum}}"&gt;{{item.invoiceNum}}&lt;/a&gt;&lt;/td&gt;
          &lt;td class="inv-res3"&gt;{{item.creationDate}}&lt;/td&gt;
          &lt;td class="inv-res4" ng-init="invoices.total.amount = invoices.total.amount + item.amount"&gt;{{item.amount | currency}}&lt;/td&gt;
          &lt;td class="inv-res5"&gt;$
            &lt;input ng-validate="number" type="number" class="input-mini" ng-model="item.payment" ng-change="getTotal()" step="0.01"  /&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;table class="table"&gt;
      &lt;tbody&gt;
        &lt;tr class="totals-row" &gt;
          &lt;td colspan="3" class="totals-cell"&gt;&lt;h4&gt;Account Balance:&amp;nbsp;&lt;span class="status-error"&gt;{{invoices.total.amount | currency }}&lt;/span&gt;&lt;/h4&gt;&lt;/td&gt;
          &lt;td class="inv-res4"&gt;&lt;h5&gt;Total to pay:&lt;/h5&gt;&lt;/td&gt;
          &lt;td class="inv-res5"&gt;{{total | currency}}&lt;/td&gt;
          &lt;td class="inv-res6"&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  </code></pre>
  
  <p>And here is the JavaScript:</p>
  
  <pre><code>    myApp.controller('invoiceList', ['$scope', '$http', function($scope, $http) {
      $http.get('assets/js/lib/angular/invoices.json').success(function(data) {
          $scope.invoices = data;
      });
  
      $scope.sum = function(list) {
           var total=0;
           angular.forEach(list , function(item){
              total+= parseInt(item.amount);
           });
           return total;
      };
  
  
  
      $scope.total = 0;
      $scope.getTotal = function() {
          $scope.total = 0;
          $scope.invoices.forEach(function(item){
              $scope.total += parseFloat(item.payment);
          });
      };
  
      $scope.pushPayment = function(item){
          if($scope.checked == 'checked'){
            return item.payment;
          }
      };  
  
  }]);
  </code></pre>