angularjs ng-repeat倒叙
<div ng-app="myApp" ng-controller="customersCtrl"> <table> <tr ng-repeat="x in names|orderBy:'Country'| reverse"> <td>{{ x.Name }}</td> <td>{{ x.Country }}</td> </tr> </table> </div>
上面的reverse是自定的过滤器!
app.filter('reverse', function() { return function(items) { return items.slice().reverse(); }; });
reverse()是js提供的倒叙方法