$digest and $apply propagate scope changes; manual $apply fixes third-party callbacks outside Angular.
Third-party callbacks outside Angular must call $scope.$apply() or use $timeout so bindings update.
Important interview questions and answers
- Q: Why does this matter?
A: $digest and $apply propagate scope changes; manual $apply fixes third-party callbacks outside Angular.
Self-check
- Summarize Digest cycle in one sentence.
- What would you try next in the playground?
Challenge
Digest cycle hands-on
- Edit the default code.
- Click Run in browser.
- Confirm preview or terminal output.
Done when: preview or terminal matches the lesson goal.
Pitfall: Third-party callbacks (maps, websocket) must call $scope.$apply or bindings look frozen.
Interview prep
- When is $digest needed?
Angular schedules digests after DOM events; call $apply when code outside Angular mutates scope.