angularjs hide data on checkbox tick

I want to hide rows of data with a specific class when a checkbox is selected.


So now when it’s ticked value1 is true, as per the official angular api docs.
Angularjs ng-show based on variable is as simple as this:


But now to link this to the checkbox aswell in an expression it would look like this:


Changing the ng-show to ng-hide and adding in the $scope variable check (which is mapped to the checkbox using ng-model) we can get the desired results.




Sam Deering

Sam Deering

Sam is a web developer, online entrepreneur and investor. In his spare time he enjoys coding, playing chess and sharing what he learns with others.

Leave a Reply

Your email address will not be published. Required fields are marked *