title: Function Called Multiple Times in AngularJS Repeat Section
body: <p>I'm running into an issue where I want to bind to the output of a function inside of an ng-repeat loop.  I'm finding that the function is being called twice per item rather than once as I'd expect. Here's the ng-repeat section (notice the calcRowTotal() call at the end):</p>
  
  <pre><code>&lt;tr ng-repeat="row in timesheetRows"&gt;
      &lt;td&gt;
          &lt;select ng-model="row.categoryID"&gt;
              &lt;option ng-repeat="category in categories" value="{{category.id}}"&gt;
                  {{category.title}}
              &lt;/option&gt;
          &lt;/select&gt;
      &lt;/td&gt;
      &lt;td ng-repeat="day in row.dayValues"&gt;
          &lt;input type="text" ng-model="day.hours" /&gt;
      &lt;/td&gt;
      &lt;td&gt;{{calcRowTotal($index, row)}}&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>The calcRowTotal() function is shown next:</p>
  
  <pre><code>$scope.calcRowTotal = function (index, row) {
      console.log('calcRowTotal - Index: ' + index);
      var total = 0;
      for (var i = 0; i &lt; row.dayValues.length; i++) {
          var num = parseFloat(row.dayValues[i].hours);
          if (isNaN(num)) {
              num = 0;
              //this.dayValues[i].hours = 0;
          }
          total += num;
      }
      //updateDayTotals();
      return total;
  }
  </code></pre>
  
  <p>An example of one of the items being iterated through is shown next:</p>
  
  <pre><code>{
      categoryID: 2,
      dayValues: [
                      { day: $scope.days[0], hours: 5 },
                      { day: $scope.days[1], hours: 0 },
                      { day: $scope.days[2], hours: 3 },
                      { day: $scope.days[3], hours: 0 },
                      { day: $scope.days[4], hours: 2 },
                      { day: $scope.days[5], hours: 5 },
                      { day: $scope.days[6], hours: 8 }
      ]
  }
  </code></pre>
  
  <p>I'm seeing the following in the console (two items are currently in the collection I'm looping through):</p>
  
  <pre><code>calcRowTotal - Index: 0 
  calcRowTotal - Index: 1 
  calcRowTotal - Index: 0 
  calcRowTotal - Index: 1 
  </code></pre>
  
  <p>I could certainly make a "rowTotal" property but would prefer to bind to "live" data provided by the function shown above. Hopefully the duplication is something simple I'm missing so I appreciate any feedback on why I'm seeing the duplication. As a side note, as data in one of the textboxes changes I need to update the row totals as well so it may be I need a different approach. Interested in understanding this particular situation first though....definitely don't want the duplication because there could be a lot of rows potentially.</p>
  
  <p>Here's an example: <a href="http://jsfiddle.net/dwahlin/Y7XbY/2/">http://jsfiddle.net/dwahlin/Y7XbY/2/</a></p>