I have a model that renders a list of checkboxes. When I check one box I would like any other checked boxes to become unchecked. The below code seems to iterate fine, but the html is not reflecting the changes. What am I missing?
HTML:
<tr ng-repeat="x in commonOrders">
<td>{{x.ProductName}}</td>
<td>{{x.ProductItemCode}}</td>
<td>{{x.ProductSize}}</td>
<td><input type="checkbox"
ng-click="updateCommonProduct(x)"
ng-checked="x.IsChecked"/></td>
</tr>
angular/javascript:
$scope.updateCommonProduct = function(product) {
// uncheck non-selected common orders
angular.forEach($scope.commonOrders, function(value, key) {
if (value.ProductItemCode !== product.ProductItemCode) {
value.IsChecked = false;
}
}, $scope.commonOrders);
};