vendredi 21 décembre 2018

Make input checkbox update when clicked, not when data is done

There is an input checkbox which can be clicked to be checked or unchecked:

<input
    type="checkbox" 
    ng-model="$ctrl.checkedOrNot"
    ng-change="$ctrl.doSomething()"
/>


doSomething() {
    this.MyService.setInput(this.checkedOrNot);
    if(this.loading) return;
    this.doStuff();
    this.doOtherStuff();
}

For the moment the check appears only after all the calls from doSomething are done. Is there a way to make it appear right when it's clicked?




Aucun commentaire:

Enregistrer un commentaire