for some reason I can't get working $watch for dynamically changing array
$scope.a1 = 1;
$scope.a2 = 2;
$scope.q = [$scope.a1, $scope.a2];
$scope.$watch('q', function(newVal) {
alert(newVal);
}, true);
nothing happened on change. Bug I get alert on the initialization.
http://jsfiddle.net/qwertmax/FtLH8/
this it just example of my project where I have to "watch" number of values (input fields). That fields generated automatically by json request.
So, I heed help with dynamically add values to "$watching"