0

On ng-click of a <div> I am showing a particular <div> and doing some filtering. I need the filter to happen on more than one value.

In the code below I want something like

filter if evaluationStatusId == 11 or 12

HTML :

<div style="font-size:40px;margin-top:10px" ng-click="clickedStatus='9'">
                                    {{Approved}}
</div>
 <div style="font-size:40px;margin-top:10px" ng-click="clickedStatus='10'">
                                    {{submitdMissnDocs}}
 </div>
<div style="font-size:40px;margin-top:10px" ng-click="clickedStatus='11 || 12'">
                                    {{Denied}}
 </div>

 <div class="row" name="empList" id="empList" ng-show="clickedStatus">
 <table class="table table-bordered table-striped">
<tbody>
<tr ng-repeat="emp in Summary.CorpEmployees | filter: {locationId:selectedItem.Label} | filter: {evaluationStatusId:clickedStatus}">
</tbody>
</table>
</div>

1 Answer 1

1

You can use a filter function like this:

$scope.myFilter = function(emp){

    return emp.locationid === $scope.selectedItem.Label || emp.evaluationStatusId === $scope.clickedStatus;

};

So your repeat expression would be:

<tr ng-repeat="emp in Summary.CorpEmployees | filter: myFilter">
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.