I have a problem to make an angularjs checkbox checked.
the basket[0].Partdelivery come frome db with 1 update() make a post to the db
<label class="checkbox-inline">
<input type="checkbox" id="inlineCheckbox1" class="checkbox" ng-model="basket[0].PartDelivery" ng-true-value="1" ng-false-value="0" ng-change="update()">
{{basket[0].PartDelivery}}
</label>
<label class="checkbox-inline">
<input type="checkbox" id="inlineCheckbox1" class="checkbox" ng-model="1" ng-true-value="1" ng-false-value="0" ng-change="update()">
</label>
And I also tested this in the html:
<div ng-controller="basketController as bc" ng-init="basket={basket}; deliveryaddress={deliveryaddress}; getcheckboxes(basket[0].PartDelivery)">
<input type="checkbox" id="inlineCheckbox1" class="checkbox" ng-model="partDeliveryCheck.value" ng-true-value="1" ng-false-value="0" ng-change="update()">
in the controller:
$scope.getcheckboxes = function(PartDelivery){
$scope.partDeliveryCheck={value: PartDelivery};
};
but the checkbox is not checked...