0

I am new in angular.js

I am dealing with large no.of records like 70,000 i have to bind all record in one grid it takes to much time for binding.

for paging i am using dir-pagination is there any possibility in dir-pagination or ng-repeat that first only bind 100 records if i am going to change my page another records are bind.and when i am going to search , filter will apply to all records. for search functionality, i have all records in client side so that server-side paging is not possible for my case

Thanks in advance

pooja shah
  • 331
  • 1
  • 4
  • 15

1 Answers1

0

You should load different pieces of data based on your page number:

<paging-directive ng-model="currrentPage" ng-change="newPage">

<div ng-repeat="item in items"> 
  <div>{{item.data}}</div>
</div>

and in your controller:

var allData = []; //70000 items;

$scope.currentPage = 1;

$scope.newPage = function(){
  $scope.items = allData.slice(($scope.currentPage - 1)*100, $scope.currentPage *100);
};

$scope.newPage();
Mahmoud
  • 844
  • 1
  • 10
  • 17
  • agree with your answer but in my table there is also search functionality so if i search something the filter will apply only in items array not in allData array. is there any possibility that i am filtering in allData record ? – pooja shah Feb 23 '16 at 04:57