I have a problem with observable chaining.
My goal is to have this result :
{Pagination, Process[]} and Process = { ....., Variables[]}
I'm calling a service which return an object {Pagination, Process[]} but Variables in Process are empty.
So i need to complete the process object with Variables properties.
I do :
this.processesService.getData().subscribe(() => { // data });
getData: Observable<any> {
let processesResult = fromPromise( .... );
return processesResult.pipe(
map( (result) => { <= result is list of process without variables
let entries = new Array();
result.entries.map( **process** => {
result.entries = entries;
this.getCompleteProcess(**process.id**).subscribe((_process) => {
entries.push(_process) <-- the process with Variables[] for enrich result map
})
return result.entries;
})
})
);
}
Can you help me to resolve my problem ? i need to wait this.getCompleteProcess to populate parent object and return a complete result
thanks