diff --git a/angular-django-rest-resource.js b/angular-django-rest-resource.js index d1d8f6b..cce36c9 100644 --- a/angular-django-rest-resource.js +++ b/angular-django-rest-resource.js @@ -358,11 +358,11 @@ angular.module('djangoRESTResources', ['ng']). var paginator = function recursivePaginator(data) { // If there is a next page, go ahead and request it before parsing our results. Less wasted time. - if (data.next !== null) { + if (data.next != null) { var next_config = copy(httpConfig); next_config.params = {}; next_config.url = data.next; - $http(next_config).success(function(next_data) { recursivePaginator(next_data); }).error(error); + $http(next_config).then(function(next_data) { recursivePaginator(next_data.data); }).catch(error); } // Ok, now load this page's results: forEach(data.results, function(item) {