0

I've already read the answer: https://stackoverflow.com/a/9693933/4382683

What I want to know is when does angular decide that it's suitable to run the $digest cycle? Because when I change a property of an object in $scope, it's instantly propagated throughout. Does this dirty-checking happen every 50ms or so?

Also, is Object.watch() used anywhere in Angular?

Community
  • 1
  • 1
Faizuddin Mohammed
  • 4,118
  • 5
  • 27
  • 51

1 Answers1

0

It's not based on time period. Angular actually $digests only if one of the following happens:

  • Any interaction with ng tags and attribute or custom directives
  • When a promise is resolved. Like for $http or $timeout

These and probably a few other cases I don't know about. I understand now that it's not possible that the values in $scope change without any of these things happening. Hence, whenever these happen, angular does a $digest. Also, no time periods.

And, no Object.watch() anywhere since it's only for debugging purposes.

Faizuddin Mohammed
  • 4,118
  • 5
  • 27
  • 51