标签:orderby java script control class turn name custom function
<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提供的倒叙方法
标签:orderby java script control class turn name custom function
原文地址:http://www.cnblogs.com/luoyingfeng/p/6442025.html