2016-04-23 46 views

回答

0

阵列$scope.items简单的排序可以解决这个问题:

一个工作的jsfiddle是在这里:https://jsfiddle.net/yufeng/5wz6nxun/

//Add the following code after the declaration of $scope.items 
//sort the items by 'pubdate' 
$scope.items.sort(function(a, b) { 
    return b.pubdate - a.pubdate; 
}); 
+0

太谢谢你了。 –

相关问题