2016-08-14 4 views
1

最初はdirPaginationを使用しています。問題は、何かを検索すると正しくフィルタリングされますが、改ページ番号は変更されず、改ページせずにページ番号の最後の番号もすべて表示されます。nag-model検索で何かを入力するとdirページ番号が変わらない

<div data-ng-controller='productsController'> 
    <form `class='form-inline'> 
     <div class='form-group'> 
      <label>search</label> 
      <input type='text' data-ng-model='search' class='form-control' placeholder='search' /> 
     </div> 
    </form> 

    <table class='table table-striped'> 
     <thead> 
      <tr> 
       <th>#</th> 
       <th>product</th> 
       <th>imet</th> 
       </tr> 
     </thead> 
     <tbody> 
      <tr dir-paginate='product in products|itemsPerPage:12|filter:search|orderBy:sortKey:reverse'> 
       <td>{{product.id}}</td> 
       <td>{{product.productName}}</td> 
       <td>{{product.time}}</td> 
      </tr> 
     </tbody> 
    </table> 
    <dir-pagination-controls max-size='10' direction-links='true' boundary-links='true' > 
    </dir-pagination-controls> 
    <script> 
     (function(){ 
     var app = angular.module('products', ['angularUtils.directives.dirPagination']); 
     app.controller('productsController', function($scope, $http){ 
     $scope.products = []; 
     $http.get('/products/json').success(function(data){ 
      $scope.products= data; 
     }); 
    }); 
    })(); 
</script> 
</div> 
+0

dir-paginationとは、あなた自身の指令ですか? – harishr

+0

はページネーション指令を意味します。 michaelbromley/angularUtils – farzad

答えて

1

itemsPerPage最後filterにする必要があり、以下のように:より詳細な説明については

<tr dir-paginate='product in products | filter: search | orderBy: sortKey: reverse | itemsPerPage: 12'> 

michaelbromley/angularUtils/FAQでそれを確認してください。

関連する問題