NG重复指令,带过滤器,像这样:
<li ng-repeat="item in items | orderBy:‘order_prop‘ | filter:query | limitTo:4"></li>
orderBy为key值,当然也可以为变量,在controller中可定义该变量值,如:
<li ng-repeat="item in items | orderBy:oreder | filter:query | limitTo:4"></li>
controller中:
$scope.order = ‘order_prop‘;
时间: 2024-10-28 22:05:34