mercredi 11 mai 2016

Angular Checkbox Alternate

Simple problem: Two checkboxes; Both starting NOT checked; Clicking either one enables and checks while making sure the other is not checked.

<div data-ng-init="indicator=false;decision=false">
<input type="checkbox" name="aName" data-ng-click="indicator=!indicator;decision=true" data-ng-checked="indicator && decision"/>
<input type="checkbox" name="aName" data-ng-click="indicator=!indicator;decision=true" data-ng-checked="!indicator && decision"/>
</div>




Aucun commentaire:

Enregistrer un commentaire