Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

$digest and $apply

Angular Context ($scope)


Event queue Digest Loop

handle click yes no


ng-click Watchers
call $digest
watch prop_1
Have you
watch prop_2
Gmeout handle 1meout changed?
watch prop_3
onclick
handle click
Summary
²  Digest Cycle does not get triggered automatically if events
are unaware of Angular
²  Solution:
•  Call $digest after your custom code
•  Wrap your custom code inside of $apply
•  Find Angular specific service that handles the same
functionality, e.g., $timeout

You might also like