I referred to this before asking this question: AngularJs doesn't bind ng-checked with ng-model
If ng-checked
is evaluated to true
on the html
side, the ng-model
is not updated. I can't ng-repeat
as suggested in the above question because I have to use some styling for each checkbox.
Here is the plunker that I have created to illustrate my problem.
http://plnkr.co/edit/YsOsPh3vjkPMUUDa6r2t
To see what I want, please open the console, and just click on Submit
button. Please don't check any checkboxes.
ng-checked
is computed to true by a expression. To indicateng-model
is not linked, I used true there. While initiating the controller, I want all the checkboxes to be unchecked. After some ajax request, I compute theng-checked
to check the checkbox. This is when myng-model
is not update. – Wame