By:Kirito

AngularJS如何使用ngRepeat过滤排序

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';

 

posted @ 2016-01-07 18:00  丶Kirito  阅读(3465)  评论(0编辑  收藏  举报