I want to sum three values from different ng-repeat in my view, this is what I have.
<tr ng-repeat="a in data1">
<td>a.num1</td>
</tr>
<tr ng-repeat="b in data2">
<td>b.num2</td>
</tr>
<tr ng-repeat="c in data3">
<td>c.num3</td>
</tr>
<tr>
<td>(Here I want to print the sum of the three values)</td>
</tr>
I have this in my controller.
$scope.data1 = [
{
"num1": 1,
}
]
$scope.data2 = [
{
"num2": 2,
}
]
$scope.data3 = [
{
"num3": 3,
}
]
The binding is ok, I print the values coming from each ng-repeat but I need to sum does values and print the result in the last
Some help with this will be great!
angularjscode and some sample data?