我正在制作一个小型应用程序,用于对用户拥有的点列表进行排序,类似于游戏排行榜。我已经在一组对象上设置了一个 ng-repeat,并在不同的选项上设置了一个 ng-show 以在列表中显示一个跨度。跨度显示不同的分数。
我在 ng-repeat 上添加了 orderBy 过滤器,因此列表从最大到最小过滤。For instance, when the option select of 'Threads Created' is chosen, then the scores for 'Post Read' and 'Posts Replied' are hidden and the list is sorted by the number of Threads Created (largest to smallest).
它适用于两个选项值,但不适用于第三个。知道为什么吗?
<tr ng-repeat="user in users | orderBy:['-created','-read','-replied']">
<td> {{user.index}} </td>
<td> {{user.firstName}} {{user.lastName}}</td>
<td>
<span ng-show='discussionsSelect == "created"'>{{ user.created }}</span>
<span ng-show='discussionsSelect == "read"'>{{ user.read }}</span>
<span ng-show='discussionsSelect == "replied"'>{{ user.replied }}</span>
</td>
</tr>