I need help with my code. How can I retrieve the names from an array and display them in my input box? Also, how do I get all the changed names back into the array? Thanks in advance! - Marco
app.js
var g[];
var names = ['John', 'Steve', 'Mark', 'George'];
for (var i = 1; i <= 4; i++){
g.push({myCount: i, myName: names[i]});
};
$scope.allnames = g;
$scope.Calculate = function (??????) {
console.log(' INDEX = ' + myCount ???????);
console.log(' CHANGE NAME = ' + myName ???????);
};
index.html
<div class="row" ng-repeat="testx in allnames">
<input type="text" class="form-control" ng-model="testx.myCount"/>
<input type="text" class="form-control" ng-model="testx.myName" ng-blur="Calculate(?????)" />
</div>