我的模板中有以下 div:
<div ng-repeat="item in billing_history | orderBy:'-timestamp'">{{ item.date }}</div>
console.log(JSON.stringify($scope.billing_history))
给了我以下内容:
{
"May, 2015":{
"date":"May, 2015",
"timestamp":1432921230
},
"March, 2015":{
"date":"March, 2015",
"timestamp":1427846400
},
"February, 2015":{
"date":"February, 2015",
"timestamp":1425168000
}
}
无论如何,这就是显示的内容:
February, 2015
March, 2015
May, 2015
我试过orderBy:'-timestamp'
了orderBy:'+timestamp'
我真的不确定为什么这不起作用。有没有人看到任何可能出错的地方?