mardi 16 juin 2020

Keep checkbox unchecked until onclick function returns true with AngularJS

Using AngularJS framework, in my HTML code I have this checkbox:

<input type="checkbox" ng-checked="switch.isOn()" ng-click="SwitchController.setValue()"> 

When clicked, the checkbox is checked/unchecked before the setValue function get executed. I want the checkbox not to be checked if the setValue() function returns false value.




Aucun commentaire:

Enregistrer un commentaire