i have one observable function named processList(request)
which returns list of processes inside the page, and i need to get list of linked processes for each returned process, for that i use another observable function which returns list of linked processes for given process linkedProcessesList(process.id)
, so like this:
let listOfProcesses = [];
let listOfLinkedProcesses = [];
this.processEndpoint.processList(request).subscribe(result => {
//getting list of processes for that page
listOfProcesses = result.data;
// now i need to get list of linked processes for each process in the listOfProcesses array
listOfProcesses.forEach(process => {
this.processEndpoint.linkedProcessesList((process.id).subscribe(result1 => {
// here how do i populate listOfLinkedProcesses array?
// this.processToProcessLinkList.push(...result1.data); <- this doesn't work gives an error
}
});
}
}