Try to fix failed queries and dupliquates queries to the server

Hi, the second commit is probably not the right thing to do, i have found no other way to have one query per click.
Ok, good idea :)

Le 13/06/2014 17:02, Joe Nelson a écrit :
>
> In src/paginate-anything.js:
>
> >            $scope.updatePresets();
> >
> > -          $scope.$watch('page', function(newPage, oldPage) {
> > -            if(newPage !== oldPage) {
> > -              $scope.gotoPage(newPage);
> > -            }
> > -          });
> > +		
> > +          $scope.$watch('page', function(newPage) {
> > +              if(newPage < 0 || newPage*$scope.perPage > $scope.numItems) {
> > +				  return;
> > +			  }
> >
>
> What if we put lines 165-170 into a new function like |loadPage|? This 
> logic is repeated in gotoPage as well.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/begriffs/angular-paginate-anything/pull/18/files#r13754422>.
>