Skip to content Skip to sidebar Skip to footer

Ng-show Records Of Table On Condition

I am trying to show rows and their sum of value of columns. It has three states on which condition held. 1) auto 2) live 3) autolive (not present in json, need auto and live combin

Solution 1:

try this workaround: ng-show="toggleValue.indexOf(siteData.jobType) > -1"

Solution 2:

You need to create a custom filter function like this: (can be named anything)

<tr ng-repeat="siteData in siteObject.data | filter: customFilter">

And, in your controller, you can implement some custom logic for that. Something like this:

$scope.customFilter = function(obj) {
  if($scope.toggleValue !== 'autolive') {
    return obj.Type === $scope.toggleValue      
  } 
  returntrue;
}

That should do it!

Here's working codepen example

Post a Comment for "Ng-show Records Of Table On Condition"