2016-08-15 14 views
0

表示可能なデータがフィルタを超えた後にページネーションを追加したいとします。私は一度に6つのデータの限界を表示できると宣言しました。私は、テーブルの下に改ページを追加して残りのデータを表示したいと思います。それをどうやって行うのですか?データが限界を超えた後にページ分割を追加する

Data.HTMLに

<section> 
    <div> 
    <table style="width:90%" class="table table-bordered" align="center" ng-controller="RetrieveDiaryController"> 
      <tr> 
        <th style="width:40%">Date</th> 
        <th style="width:30%">Type</th> 
        <th style="width:30%">Level</th> 
      </tr> 
     <tr ng-repeat="d in diaries | orderBy:'date':true | limitTo : limit"> 
     <td>{{d.date | date: "dd-MM-yyyy"}}</td> 
     <td>{{d.taken}}</td> 
     <td>{{d.level}}</td> 
     <tr ng-show="limit" ng-click='limit = undefined'> 
     </tr> 
    </table> 
    </div> 
    </section> 

health.js

.controller('RetrieveDiaryController', ['$scope', 'Diary', function ($scope, Diary) { 
     $scope.diaries = Diary.find(); 
     $scope.limit = 6; 
    }]) 
+0

これを行うには、datatableライブラリを使用します。 – Mox

+0

ぺージネイトアイテムの仕方を教えてくれる質問がたくさんあります。私はこの[**モジュール**](https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination)をお勧めします。 – developer033

答えて

関連する問題