I noticed that Angular is less-than-conservative when it comes to reading $scope properties. When the app/controller first instantiate, each bound property defined in the model
Angular handles two-way binding. The way it does it is through dirty checking. It checks any watched property at the top of the digest and then at the bottom of the digest (twice). It then compares the values to see if anything changed. This is the way it knows whether it needs to rebind the UI. Read this article for reference.
The digest cycle runs anytime there is an $apply
called on the scope. Angular does this often (inside its own directives, e.g. ng-click
).