HTML code to display table -
<table class="table table-bordered table-striped table-condensed">
<thead class="TableHeader">
<tr>
<th>Role</th>
<th>Name</th>
<th>ID</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="i in allCustomerInfoArray track by $index" ng-click="showCustomerinfo($index)">
<td>{{i.role }}</td>
<td>{{i.name}}</td>
<td>{{i.id}}</td>
</tr>
</tbody>
</table>
Angular JS code to display the customer info in the console log -
$scope.showCustomerinfo=function(index) {
console.log("table clicked row -- "+index);
console.log("DOB -- "+$scope.allCustomerInfoArray[index].role);
console.log("Age -- "+$scope.allCustomerInfoArray[index].name);
console.log("Age -- "+$scope.allCustomerInfoArray[index].id);
console.log("DOB -- "+$scope.allCustomerInfoArray[index].dob);
console.log("Age -- "+$scope.allCustomerInfoArray[index].age);
}
Now I want to modify the above code to hide the rows where the customer role is "XXX". Please let me know how to achieve it.
Note - I do not want to delete the customer with role "XXX" from allCustomerInfoArray.