I don't know if my answer will suit you but, you can create an empty array object in your component and when you do the RESTAPI call you just do a push
on the object.
Something like:
private arrayObject: any = [];
this.http.getbooks().subscribe(
data=>{
this.getbooksinfo=data;
this.arrayObject.push(this.getbooksinfo);
}
)
this.http.getauthors().subscribe(
data=>{
this.authors=data;
this.arrayObject.push(this.authors);
}
)
EDITED ---
Following edkeveked comment, you can user forkJoin, but need to change a little bit your code.
import { forkJoin } from "rxjs/observable/forkJoin";
let apibooks = this.httpClient.get('YOU_API_URL');
let apiauthors = this.httpClient.get('YOU_API_URL');
forkJoin([apibooks, apiauthors]).subscribe(results => { console.log(results); // will print array of results;
console.log(results[0]); // will print apibooks results;
console.log(results[1]); // will print apiauthors results;
});
Print to console log so you can understand whats happening.