我有嵌套纳克重复从服务器提取数据:使用ORDERBY为值在阵列
<div ng-repeat="x in result | filter:sellbox " >
<div ng-repeat="z in x.data | orderBy:'??' " >
{{x.rate_type}} to {{x.name}} {{z[1]}}
</div>
</div>
这是服务器的一部分:
"result":[
{
"id":"BNLN_USD",
"code":"BNLN",
"name":"National Bank Of Georgia (BNLN)",
"currency":"USD",
"rate_type":"reference",
"color":"#4b4a4b",
"legendIndex":1,
"data":[
[
1473033600000,
2.2938
]
]
},
{
"id":"BAGA_USD_B",
"code":"BAGA",
"name":"Bank Of Georgia (BAGA)",
"currency":"USD",
"rate_type":"buy",
"color":"#ed7623",
"dashStyle":"shortdot",
"legendIndex":2,
"data":[
[
1473033600000,
2.25
]
]
}
Z [1]给出该分部的价值为2.2938和2.25。如何使用orderBy,以便按z [1]的降序排列结果。
不在我的情况下:) – NewLuckyProgramer
注意:如果您注意到数字未按预期排序,请确保它们实际上保存为数字而不是字符串。 –