JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app>
<div ng-controller="Ctrl">
<ul>
<li ng-repeat="item in Data">
<input ng-model="item.Value" />
</li>
</ul>
Total: {{sum(Data)}}
</div>
</div>
JavaScript
function Ctrl($scope) {
$scope.Data = [
{
Value: 1
},
{
Value: 2
}];
$scope.sum = function(list) {
var total=0;
angular.forEach(list , function(item){
total+= parseInt(item.Value);
});
return total;
}
}