0

I have following structure in my html page:

<ul data-ng-controller="ListCtrl">
   <li data-ng-repeat="record in records">
      <div>.............</div>
   </li>
</ul>

I have total 15 records which are displaying on the same page.

I need to divide these pages like 1-5, 6-10, 11-15, so if i added limitTo: 5 then it showing only first 5 records. I need to see the rest of records also like 6-10 & 11-15 on the next page.

Is there any kind of filter in angularJS or any other way to do it ?

4

2 回答 2

1

您可以使用自定义“来自”过滤器:

app.filter('from', function() {
    return function(data, from) {
        return data.slice(parseInt(from));
    }
});

es: data-ng-repeat="record in records | from: 5 | limitTo: 5"

于 2013-05-06T09:39:31.773 回答
1

Try angularjs ui directives based on bootstrap

http://angular-ui.github.io/bootstrap/

于 2013-05-06T06:52:01.757 回答