Angular 2 Http, Observables and recursive requests
I have a REST endpoint that returns a list of items, max 1000 items at a time. If there are more than 1000 items, the response has HTTP status 206 and there's a Next-Range header that I can use in my next request for getting more items. I'm working on an Angular 2 application and trying to implement this with Http and Observable . My problem is that I don't know how to merge multiple Observable s depending on how many pages of items there are and finally return one Observable that my component can subscribe to. Here's where I've got with my current TypeScript implementation: // NOTE: Non