#issue with observable data being obtained in component

5 messages · Page 1 of 1 (latest)

cerulean wadi
#

I have a parent component named recipes, which calls in ngOnInit this.recipeService.getRecipes().subscribe(); the code within this method is as follows: public getRecipes(): Observable<Recipe[]> { return this.fetchRecipes() .pipe(take(1), map((recipes: Recipe[]) => recipes.map((recipe) => ({...recipe, extraData: 'extraData')), tap((recipes: Recipe[]) => { this._recipes.next(recipes) } ))); } now within my child component recipe list, i try to do *ngFor= "let recipe of recipeService.recipes | async" though do not see any results.. any ideas?

#

(adding logs in the tap does not output anything)

#

for some reason removing the map fixes my issue???

solemn rock
#

Show the relevant code. What is recipeService.recipes? Why do you have two different observables?

cerulean wadi
#

i think i figured it out thank you!