I made a grid consisting of 15 images which i fetched from a firebase database using angularfire2. I looped through the array, got each image, set an index (1..15), and showed them in the view.
Each image has a userID attached, but the user object is stored in another separate database:
I set the index in the ngFor loop like so:
*ngFor="let story of storiesArr; let i = index;" id={{i}}
And the index to the users:
this.storiesArr.forEach((story, index) => {
this.getUserProfiles(story.userId, index)
});
Expected outcome: So if user has uploaded a story, i need to put the userPicture from the corresponding user object to the view inside the ngFor loop.
Current status: I have all the data, and the indexes corresponding to which user uploaded a specific story.
How do I approach this?