Reputation: 20555
i have an array that consists of multiple objects.
$scope.userCompetences = [];
Now i have a deep watch on this array to check for changes:
$scope.$watch('userCompetences', function (newVal, oldValue) {
if(oldValue.length > 0)
{
var i = 0; // do something
}
}, true);
Now my question is how can i get the index of the object in the array that has changed ?
Upvotes: 1
Views: 1975
Reputation: 4319
Did you try to just call a function when this happens?
<div ng-repeat="item in userCompetences">
<input type="text" ng-model="item.name" ng-change="change_function($index)"/>
</div>
Upvotes: 3