remove redundant iteration in ng-pagination