Uncheck all checkboxes


How do I programmatically uncheck all check boxes given a certain class?

I know the ion-checkbox is rendered as a button so just setting the attribute on the element doesn’t work.


Actually, you can do this:

<ion-checkbox [(ngModel)]="aBooleanVariable"></ion-checkbox>

Assign a boolean variable to each checkbox you have. Then, add a button and a function that, when clicked, assign a true or false value to all of your boolean variables.


This seems to check or uncheck all of them and not allow individual checking.


You have to assign different variables for each checkbox. Like aBooleanVariable1, aBooleanVariable2, aBooleanVariable3, etc.