我确实有以下形式的对象:
item = {key1: {count: x}} where x is an integer
我想使用计数对模板中的选项进行排序。 我通过以下方式使用 ng-options:
data-ng-options="key1 for (key1, sub_item) in item | orderBy: 'sub_item.count'"
不幸的是,排序不起作用。知道我怎么能做到这一点吗?
请您参考如下方法:
根据docs您必须在引号中设置 orderBy 值:
orderBy: 'sub_item.count'

