I have an array of data that gets populated dynamically via a socket event. However I can't sort the array properly with angular's ng-repeat:
socket.on('twitter:item', function(data){
var item = data;
item.time = moment(data.time).valueOf();
item.date = formatTime(data.time);
$scope.twitter.push(item);
});
<li ng-repeat="item in twitter | orderBy:time:true">
<a href>{{item.title}}</a> - {{item.time}} {{item.date}}
</li>
The html always shows the most recent at the bottom of the ordered list...I want it at the top (thus the orderBy:time:true (or false) where time is milliseconds. Neither of which work.
trueorfalse(updated post)<li ng-repeat="item in twitter | orderBy:'time':true">