My motivation for enumerating these is to finally understand what is happening beneath the covers. I understand that any code could call $apply or $digest on the scope for other circumstances. I think it's really useful when explaining to others how dirty checking works in Angular to be able to provide common examples of what can trigger it.
Since JavaScript doesn't use threads, I assume when you say "thread of execution" you are referring to the event queue. On Sun, Feb 16, 2014 at 12:29 PM, Daniel Tabuenca <[email protected]>wrote: > Your list is fine, but I question the usefulness of compiling an > exhaustive list of every time that $digest is called, especially since > third-party directives could add additional services and callbacks which > would add to your list. Quite simply, in a properly written application > $digest will be called at the end of any thread of execution, regardless of > how it is started. What you are enumerating then, is simply ways that > threads of execution can be started, and most of those just boil down to > "when an asynchronous callback gets executed". May I ask what your > motivation is for compiling this list? > > > > > On Sunday, February 16, 2014 9:49:04 AM UTC-8, Mark Volkmann wrote: >> >> I couldn't find a concise list of the things that trigger a digest cycle >> to run. >> After some investigation, I came up with the following list. >> Does this look correct? What did I miss? >> >> - bootstrap process >> - user input triggers a provided event handing directive; ex. *ng-click* >> - change to an *ng-model* property caused by user input or code >> - after *$http* promises are resolved or rejected >> - after *$timeout* and *$interval* listeners run >> - after a route change >> - calls to *scope.**$apply* >> >> -- >> R. Mark Volkmann >> Object Computing, Inc. >> > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/groups/opt_out. > -- R. Mark Volkmann Object Computing, Inc. -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/groups/opt_out.
