View cloudSettings
{"lastUpload":"2019-11-20T19:54:39.637Z","extensionVersion":"v3.4.3"} |
View Angular RXJS Combine Data in Observable
configsWithP(): any { | |
const configs = this.configsService.getConfigsList; | |
const product = (id) => this.bcProductService.getProductById(id); | |
this.test_configs = configs.pipe(flatMap( configs_ret => { | |
const final = (configs_ret as any[]).map(config => product(config.id)); | |
return zip(...final, (...args: any[]) => args).map(products => { | |
for (let i = 0; i < (configs_ret as any[]).length; i++) { | |
configs_ret[i]['p']=products[i].data; | |
} | |
return configs_ret; |