Observing an array for changes and calling a function when it does:
$scope.$watch(
$scope.aQuestions,
function checkQuestionCount(newValue, oldValue) {
debugger;
if (newValue === oldValue) {
return;
}
else getQuestions();
});
In this piece of code, $scope.aQuestions represents an array.
However, when I execute this code, newValue and oldValue are showing as undefined.