I have few queries. Pls find them below -
1) A function defined inside an ng-init like given below
ng-init='function a() {}'
errors out. Changing the syntax to variable declaration type or Instantly invoked also doesn't work. why? Since we can anyway declare a variable, object, array. Why not a function?
2) Is a $watch created for all variables tied to a scope, OR is it created to only those scope variables which are shown in the view?
3) If you run the fiddle 'http://jsfiddle.net/Lvc0u55v/5753/', there is >10 $digest iterations error. This is expected. Now please comment and uncomment as given in the fiddle. there is no error, how come? here also $scope.a's value changes infinitely right?