How does data binding work in the AngularJS framework?
I haven\'t found technical details on their site. It\'s more or less clear how it works when data
I wondered this myself for a while. Without setters how does AngularJS notice changes to the $scope object? Does it poll them?
What it actually does is this: Any "normal" place you modify the model was already called from the guts of AngularJS, so it automatically calls $apply for you after your code runs. Say your controller has a method that's hooked up to ng-click on some element. Because AngularJS wires the calling of that method together for you, it has a chance to do an $apply in the appropriate place. Likewise, for expressions that appear right in the views, those are executed by AngularJS so it does the $apply.
When the documentation talks about having to call $apply manually for code outside of AngularJS, it's talking about code which, when run, doesn't stem from AngularJS itself in the call stack.