i was facing problems with ng-repeat while using ng-checked and ng-disable with it
<div ng-repeat="module in modulelist>
<input id="switch" ng-init="setState($index);" type="checkbox" ng-checked="switch.checked" ng-disabled="switch.disable" ng-click="toggle($index,light.name)" />
i am using ng-init to load the state of the checkbox module.statusfrom the modulelist ,status can be ON ,OFF or unknown ,for unknown i want to disable the cb ,for ON/OFF i want to check/uncheck the cb. i tried using
$scope.switch={checked:true};
but it is applying the property to all the checkbox i know that 'switch.checked'/'switch.disable' should be unique for each CB to make a unique change,but i am not able to do so.
please help
Aucun commentaire:
Enregistrer un commentaire