I saw many questions related to 'dirty check'. Want to confirm my below issue is due to that.
I have JSON string from RestService: Basically two records
[{"intRowId":111,"fltAmt":6.0,"intCnt":2,"category":{"intCatId":2,"strCatName":"Rent"},"monthYear":"2016-01-01"},
{"intRowId":112,"fltAmt":3.0,"intCnt":1,"category":{"intCatId":3,"strCatName":"Phone"},"monthYear":"2016-01-01"}]
I have ng-repeat in HTML page: I am calling a method AssignValues.
<tr ng-repeat="op in resultReport">
<td>{{$index+1}}{{resultReport.length}}{{AssignValues(op.fltAmt,$index,op.monthYear)}}</td>
<td>{{op.fltAmt|currency}}</td>
<td>{{op.intCnt}}</td>
<td>{{op.category.strCatName}}</td>
<td>{{op.monthYear}}</td>
</tr>
AssignValues in my Controller: This prints four times.
$scope.AssignValues = function(amt,ind,mYr){
$log.log(amt);
}
Actually I have two records in JSON, but the function prints the values repeated more than actual length. Instead of just 6 and 3, it prints 6,3,6,3. Screen shot is attached below. Any one please help me to understand this.