Javascript Can';我不明白为什么ng repeat不排序
我有以下HTML,我想按最新注释按时间倒序排序:Javascript Can';我不明白为什么ng repeat不排序,javascript,angularjs,angularjs-ng-repeat,Javascript,Angularjs,Angularjs Ng Repeat,我有以下HTML,我想按最新注释按时间倒序排序: <div class="list list-inset" ng-repeat="(threadId, thread) in messageThreads | orderBy:'thread.newestComment'" ng-if="thread.newestComment > messageClearTime"> <div class="item item-divider">
<div class="list list-inset"
ng-repeat="(threadId, thread) in messageThreads | orderBy:'thread.newestComment'"
ng-if="thread.newestComment > messageClearTime">
<div class="item item-divider">
{{thread.newestComment}}
</div>
</div>
无论我做什么,我似乎都不知道如何进行排序——它总是按照数组的顺序出现。有什么帮助吗?orderBy过滤器仅适用于对象数组,而不适用于对象本身。见文件
{ "5381897" : {
"newestComment" : 1403280014,
"title" : "asdf"
},
"5595015" : {
"newestComment" : 1403192555,
"title" : ""
},
"5761260" : {
"newestComment" : 1403126044,
"title" : ""
},
"5838498" : {
"newestComment" : 1403279962,
"title" : "Share Test"
}
}