我想根据多个选择菜单制作orderBy。例如:
Order :
<select ng-model="filterOrder">
<option value="+">- to +</option>
<option value="-">+ to -</option>
</select>
Column:
<select ng-model="filterColumn">
<option value="name">Name</option>
<option value="age">Age</option>
</select>
<div ng-repeat="user in users|orderBy:'filterOrder.filterColumn'">
{{user.name}} {{user.age}} <br>
</div>
谢谢!
答案 0 :(得分:1)
您想使用reverse
orderBy
参数
<div ng-repeat="user in users|orderBy:filterColumn: filterOrder == '-'">
表达式filterOrder == '-'
将返回该参数的布尔值