You need to use the method forkJointo load data from multiple sources.
First of all, include them in the file typescript.
import {Observable} from 'rxjs/Rx';
, , .
forkJoin Observables. , forkJoin concurrent http .
subscribe() forkJoin Observables.
forkJoin , .
, 10 .
var pages:number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
: var pages:number[]=new Array(10).fill().map((v,i)=>i+1);
Observable.forkJoin(
pages.map(
i => this.http.get('http://swapi.co/api/people/?page=' + i)
.map(res => res.json())
)
).subscribe(people => this.people = people);