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: {{Total}}
</div>
</div>
JavaScript
function Ctrl($scope) {
$scope.Data = [
{
Value: 1
},
{
Value: 2
}];
$scope.Total = function()
{
var returnValue = 0;
for(var i = 0; i < Data.length; i++)
{
returnValue += Data[i].Value;
}
return returnValue;
};
}