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. http://jsfiddle.net/s23eW/
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.
Image

 


 

refs:

Sam is a passionate web developer, online entrepreneur and investor. In his spare time he enjoys coding, playing chess and reading.

Leave a Reply

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