I need assistance trying to get two HTTP GET responses that come object arrays and combine them into one object array for example
If possible I would like the array from http using rxjs more than likely to have a response that has all 3 objects in one array
like below
[{...}, {...}, {...}]
.ts
incidents$ = this.incidentService.getAll();
otherIncidents$ = this.otherIncidentsService.getAll();
ngOnInit() {
this.incidents$.subscribe(res => {
console.log('first http GET request', res)
})
this.otherIncidents$.subscribe(res => {
console.log('second http GET request', res)
})
Console
second http GET request [{…}]
0: {incidentNumber: 19418, createdByName: "User", execSummaryFlag:
false, followupEmail: null, …}
length: 1__proto__: Array(0)
exec-summary.component.ts:140
first http GET request (2) [{…}, {…}]
0: {incidentNumber: 19380, createdByName: "User", execSummaryFlag: false,
followupEmail:null, …}
1: {incidentNumber: 19399, createdByName: "User", execSummaryFlag: false,
followupEmail: null, …}length: 2__proto__: Array(0)