Not really a question with code, but more for my clarification. Please excuse me if this isn't the appropriate place to ask...
I was experimenting with a basic checkbox that had an ngModel assigned to it:
<input type="checkbox" ng-model="someFlag"/>
I expected this to bind the boolean value of the checkbox to $scope.someFlag (assuming the controller and everything else was set up properly). And yes, it did work. However, there were instances where I noticed it wasn't working. For example, when trying to perform an action when someFlag changes (such as in a $watch), the value wasn't truly bound.
Then, I remembered something a coworker once mentioned:
Use a wrapper object
Implementing it like this now functions without any issues:
<input type="checkbox" ng-model="wrapperObject.someFlag"/>
Observing $scope.wrapperObject.someFlag behaves as anticipated.
So, the question is: Why?