Checkbox OnCheck


#1

This is my first post. I just added a checkbox into my html code, and I was wondering how to set a oncheckchange listener.
I have tried

$("#CHECKBOX").change(function(){

});
but this doesn’t seem to be working


#2

Maybe this works http://docs.angularjs.org/api/ng.directive:ngChecked


#3

Are you using Angular or just the Ionic CSS? If using Angular, you do not want to be doing the jQuery $(…) stuff.

You should be using ng-change like :

<checkbox ng-change="tellMeItChanged()" ng-model="user.agreed">Agree?</checkbox>


#4

Thank you all for your answers. I now use angular to check for changes and it is working.


#5

Thanks, I now user angular to check for changes and it works.