角度过滤器功能



我需要让这两个下拉过滤器相互通信,这样当选择其中一个时,两者都会被过滤:

<div>                 
<div class="table-single-row select-list">
<div>
<select name="citiesSelected" id="citiesSelected" ng-change="citySelected(citiesSelected)" ng-model="citiesSelected"  >
<option value="" ng-selected=true>All regions</option>
<option ng-repeat="city in cities | unique: 'group'" value="{{city.group}}">{{city.group}}</option>
</select>                
</div>
<div>
<select name="taxonomySelected" id="taxonomySelected" ng-change="fieldSelected(taxonomySelected)" ng-model="taxonomySelected" >
<option value="" ng-selected=true>All sectors</option>
<option ng-repeat="field in fields" value="{{field.name}}">{{field.name}}</option>
</select> 
</div>
</div>            
</div>

之前误解了你的问题,由于时间限制,我只能在这里提供想法。

funciton filterByConditions() {
//Do you logic to filter result by both $scope.condition1 and $scope.condition2
}
onSelect1Change(condition1) {
$scope.condition1 = condition1;
filterByConditions();
}
onSelect2Change(condition2) {
$scope.condition2 = condition2;
filterByConditions();
}

相关内容

  • 没有找到相关文章

最新更新