I attempted to showcase the values of AngularJS
. Now I aim to aggregate all these values into its parent variable sum.
This is How my AngularJs Array Appears:
{
"isInternalInvoice":1,
"name":"Invoices",
"sum":50,
"articles":[
{
"ID":"130.0000917-17.557000506.1",
"betrag_netto":"20",
},
{
"ID":"130.0000917-17.557000581.1",
"betrag_netto":"30"
}
]
}
Snippet of Code:
<tr ng-repeat="invoice in currentInternalInvoices" >
<input type="text" ng-model="invoice.betrag_netto" />
</tr>
By making amendments in the textbox, it successfully updates the sum:
<input type="text" ng-model="$parent.data.sum" ng-bind="$parent.data.sum" />
However, I wish to automatically add up all values as I type within the loop.