Answer the question
In order to leave comments, you need to log in
How to work with arrays in RxJs?
packages.forEach((pack) => {
this.packageService.getPackage(pack.id)
.pipe(takeUntil(this.ngUnsubscribe))
.subscribe((newPack: Package) => {
this.verbosePackages.push(newPack);
this.sharedPackagesService.updatePackages(this.verbosePackages);
})
}
getParameters(): void {
this.verbosePackages.forEach((pack) => {
this.packageParameters = this.packageParameters.concat(pack.packageParameters);
})
this.getParameterVisibilities();
}
Answer the question
In order to leave comments, you need to log in
getParameters(ids: (string|number)[]): Observable<MyResult[]> {
return forkJoin(ids => ids.map(id => this.packageService.getPackage(id)))
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question