# Ionic infinite scroll not working proper

**URL:** <https://forum.ionicframework.com/t/ionic-infinite-scroll-not-working-proper/51919>\
**Category:** ionic-v1\
**Created:** [May 13, 2016, 6:15am UTC](https://forum.ionicframework.com/t/ionic-infinite-scroll-not-working-proper/51919 "2016-05-13T06:15:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![punit\_saharan](https://avatars.discourse-cdn.com/v4/letter/p/a587f6/32.png) [@punit\_saharan](https://forum.ionicframework.com/u/punit_saharan)\
**Post date:** [May 13, 2016, 6:15am UTC](https://forum.ionicframework.com/t/ionic-infinite-scroll-not-working-proper/51919/1 "2016-05-13T06:15:47Z")

</div>

hi i am new in ionic i am using ionic infinite scroll its working but not proper.if i have 50 records then first it show all the product after that we scroll its load same 50 products again i dont know how to add limit there or any type validation.here is my code

.controller(‘HomeCtrl’, function($scope, $stateParams,$http,$ionicLoading) {

```
$scope.latests = [];

$scope.loadMore = function(){

var parameters = {
	
	id: $scope.lastproductID
};	

	
 $http.get('http://mydomain.com/latest.php',{ params : parameters }).success(function(items) {
	 
  $scope.lastproductID = $scope.latests.id;
  
  angular.forEach(items,function(item){
	 
		$scope.latests.push(item);
		
  });
  
  $scope.$broadcast('scroll.infiniteScrollComplete');
  
});
	
};
```
