【问题标题】:AngularJS orderBy child not working [duplicate]AngularJS orderBy子不工作[重复]
【发布时间】:2014-04-06 08:38:23
【问题描述】:

angularJS 中 element 选项的 orderBy child 不起作用。 我想按“pos”孩子订购。谢谢

$scope.commands = {
"xyz" : {
"group":"g2",
"pos":2
},
"abc" : {
"group":"g2",
"pos":3
},
"ijk" : {
"group":"g1",
"pos":1
}
};

<div ng-repeat="(key, data) in commands | orderBy:'data.pos'">{{data.pos}} - {{key}}</div>

【问题讨论】:

标签: angularjs


【解决方案1】:

ng-repeat 中的过滤器仅适用于数组而不适用于对象,您已编写自定义过滤器并对其进行排序。

我会尝试创建一个并分享。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-05-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多