My view has
<input type="checkbox" class="check_box" ng-model="campaign.paused"
ng-click="CampaignPauseClicked(campaign, $event)" />
<p>campaign.paused == {{campaign.paused}}</p>
with the <p> being for debugging. It shows false, as it shoudl, given the data, but in the controller
$scope.CampaignPauseClicked = function(campaign, $event)
{
campaign.paused = ! campaign.paused;
when I breakpoint on the first code line, the value of campaign.paused is true (!).
I have searched the code and campaign.paused is not being written elsewhere.
Any idea what could be happening here?
[Update] I am using an ng-click fucntion, which I have not shown in its entirity, because I need it to "swallow" the $event and prevent it from propogating to the parent.
campaign.paused = ! campaign.paused;its normal forcampaign.pausedto be trueng-model="campaign.paused"gets the value oftruethis is done automatically because of Angular. What you do in your code is to reverse that and have true when the checkbox is not clicked and false when it is. It looks that you need to read on the ng-model directive docs.angularjs.org/api/ng/directive/ngModel