I am trying to make a database update if a checkbox is checked. Is there a way to do it with Ionic? I don't want to refresh the view or go to a different view. Looking to do similar to the facebook like on the web.
ion-checkbox ng-model="myvalue"
I am trying to make a database update if a checkbox is checked. Is there a way to do it with Ionic? I don't want to refresh the view or go to a different view. Looking to do similar to the facebook like on the web.
ion-checkbox ng-model="myvalue"
Yes. Basically you could to one of two thigs.
1) Create a ng-click on the checkbox that then calls a method on the controller which then calls a $http.put or whatever you like. you could pass the value to the method or just read it from the model.
2) By putting a watch on myValue like this:
$scope.$watch('myValue', function() {
alert('myValue has changed!');
});