AngularJS:orderBy不工作

时间:2014-12-06 17:57:17

标签: angularjs

所有工作但订单不按订单排序项目(value.points是数字)

<a class="item" ng-show="showResults" ng-repeat="(key, value) in event.tournaments | orderBy:'value.points'">
  <h3>{{key}} {{value.imitation}}</h3>
  <span class="badge badge-assertive">{{value.points}}</span>
</a>

2 个答案:

答案 0 :(得分:1)

documentation开始,orderBy仅订购数组。 (键,值)sintax适用于对象。也许在一个数组中转换你的字典就可以了。

答案 1 :(得分:0)

不应该是orderBy:value.points而不是orderBy:'value.points'吗?