I'm struggling with sorting the following HTML in reverse chronological order based on the newestComment:
<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>
The data (messageThreads) consists of threadIds as keys and corresponding newestComments as timestamps:
{ "5381897" : {
"newestComment" : 1403280014,
"title" : "asdf"
},
"5595015" : {
"newestComment" : 1403192555,
"title" : ""
},
"5761260" : {
"newestComment" : 1403126044,
"title" : ""
},
"5838498" : {
"newestComment" : 1403279962,
"title" : "Share Test"
}
}
Despite my efforts, I can't seem to get it to sort correctly—it always appears in the original array order. Any suggestions?