I am currently facing an issue with using two filters in my ng-repeat. Here is how I have set it up:
<tr ng-repeat="c in datasets | filter:filterDataSet | filter:filterExpressionforPerspective | orderBy:'-id'" id="{{c.data_id}}" animate-on-change='c.program_name + c.organization + c.data_type_fmv_wami + c.perspective + c.status' ng-animate="'animate'">
Initially, when I only have the first filter 'filter:filterDataSet', all of the data displays correctly on the page. Here is how I am implementing 'filter:filterDataSet':
Filter: <span class="input-icon">
<input placeholder="Filter dataset list..." class="nav-search-input" ng-model="filterDataSet" ng-change="resetLimit();" autocomplete="off" type="text" style="width:300px;" focus>
<i class="search-icon fa fa-search nav-search-icon"></i>
</span>
However, when I add the second filter 'filter:filterExperessionforPerspective', the data no longer appears on the page and only shows based on 'filter:filterExperessionforPerspective'. Below is a snippet of code for 'filter:filterExperessionforPerspective' where a dropdown is used:
Angular code:
$scope.filterExpressionforPerspective = function(dataset) {
return (dataset.perspective === $scope.selectedPerspective.value);
};
HTML dropdown:
<label for="PerspectiveDD">Perspective
<select name="PerspectiveDD" ng-model="selectedPerspective" style="color:black;" ng-options="Perspective as Perspective.value for Perspective in perspectiveOptions">
{{selectedPerspective.value}}
</select>
</label
I am trying to understand how to make both filters work as an 'OR' instead of chaining them as an 'AND'. Any assistance would be greatly appreciated! Thank you.