I am working with a REST api that provides a paged response for GET requests, for example:
{count: 43103
previous: null
next: http://ecoengine.berkeley.edu/api/photos/?page=2
results: [json objects....]
}
I would like to create a service that loads all the data, following the link nextuntil nextit becomes zero. I am stuck in the promises chain in this scenario and would appreciate any help on how to proceed (angular / js newbie here). My plunker with where I got it so far is here http://plnkr.co/edit/ySiQLvu9RNrKkQAoDmKh . From the console messages you can see that the code retrieves data only from the first 2 pages. Thanks.
source
share