I managed to create a function for successfully switching rows in my ng table to expand on click, however, when clicked again, they will not be hidden. Function in javascript:
$scope.toggle = function() { return !this.booleanVal; };
booleanVal is the value from the json file (each line with its own value). Then in HTML.
<p class="row_description more" ng-click="row.booleanVal = toggle()">{{row.description}</p> <div class="check-element animate-show" ng-show="row.booleanVal">
It works for the first click, turning previously false booleanVal to true , however it does not toggle return to false . Any idea what goes wrong?
source share