I am struggling in the angularjs average calculating problems, here is the situation
The table's data are drawn from server and update regularly itself (by ajax), I want to calculate at the same time the average of the column and display the result at the last row of the table. The following are the relevant codes on displaying the table
<tr ng-repeat="rowData in pData">
<td ng-repeat="cellData in rowData track by $index">{{cellData}}</td>
</tr>
<tr>
<td>{{averDatum}}</td>
(need to calculate 6 column's average)
</tr>
Where the cellData are displayed via
$http({method: 'GET', url: './partials/getData.php?getTblData=1'}).
success(function(data, status, headers, config) {
// this callback will be called asynchronously
// when the response is available
$scope.pData = data.rowData;
$scope.upData = data.dateData;
});
And the data format is
Thanks all for the help!