Created
December 7, 2018 15:00
-
-
Save ohabash/d098bcb277eb15b9a7192463350a3973 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}); | |
})); | |
this.test_configs.subscribe(configss=> { | |
this.configs = configss; | |
this.merged = true; | |
this.configsExist = true; | |
this.configsService.Configs = configss; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment