I want to create Observables in a loop and wait for them all to be finished.
for (let slaveslot of this.fromBusDeletedSlaveslots) {
this.patchSlave({
Id: slaveslot.Id,
BusOrder: null,
BusId: null
});
}
The patchSlave() Function returns a Observable.
patchSlave(slaveslot: any): Observable<any> {
return this.httpClient.patch(environment.apiBaseUrl + `/odata/SlaveSlots(${slaveslot.Id})`, slaveslot);
}
I don't know the best way to solve this. I think I have to omit the loop a replace a with something from Rxjs?