I have an array, that contains objects. Each object has a boolean varaible (array[i].check). I want to make a table using AngluarJS that by clicking on a checkbox it directly change a boolean value of a specific object within my array.I use:
<table>
<tr data-ng-repeat="a in array">
<td style="width:200px;"> {{a.name}}</td>
<td><input type="checkbox" ng-model="a.check" ng-checked="a.check"></td>
</tr>
</table>
But the value of every boolean remains false always. What I am doing wrong?
a.checka Boolean or a String? In other words if you look at the actual value is itfalseor"false"?ngModelandngChecked. See the docs: ngChecked.ngModelinstead of both.ng-checkedandng-modelseparately