是否可以保存orderBy,以便在用户对数据进行排序然后刷新页面时,最后一种排序(列和升序/降序)是否仍然明显?
以下是我的观点。
<table>
<tr class="sortheaders">
<th class="small"> </th>
<th class="medium"><a href="javascript:void(0)" ng-click="order('name');" title="Sort by Name">Name</a></th>
<th class="medium"><a href="javascript:void(0)" ng-click="order('age');" title="Sort By Age">Age</a></th>
</tr>
<tr ng-repeat="result in results | orderBy:predicate:reverse">
<td>{{$index+1}}</td>
<td>{{ result.name }}</td>
<td>{{ result.age }}</td>
</tr>
</table>