I have an array as shown below
var testData = {
section1: [{
Number1: 0
}],
Total: 0
}
In the array above, I can have the number of ui elements associated with the number as text fields. I want to change each value of a text field to update "Total" in testData.
Example:
If I hav e 3 text fields bound to Number1 with values of 10, 20, 30, the total value should be 60, that is 10 + 20 + 30.
I tried using $ scope. $ watch, I'm not sure how to watch an array of arrays inside an array.
Please, help.
source
share