<textarea ng-model="statement" name="statement"></textarea>
when i typing some values in text area i can trigger a function in cotroller by using
var autosave = function(newVal, oldVa){
console.log('inside the function');
}
$scope.$watch('statement', autosave);
here i want to check the value array contain some value, if the values exist i want to trigger some function in controller
$scope.testAry =[];
i am going to push some values
$scope.testAry.push({username: jenson});
This time the array contain the values so i need to trigger a function
$scope.$watch('testAry', autosave); // not working
can anyone help me to trigger the autosave function if the array contain at least one value