I have the following array in component class (Angular 5):
this.collectionAdmins = ['uid_73hd', 'uid_38ng'];
Since I have tables in my database(firebase) with users info, I want to loop through the this.collectionAdmins array, retrieve each user information from the database, So will be able to display that info in the template.
'uid_73hd': {
"bio": "about me info",
"email": "[email protected]",
"status": "online",
"uid": "uid_73hd",
"username": "mary"
},
'uid_38ng': {
"bio": "about me info",
"email": "[email protected]",
"status": "online",
"uid": "uid_38ng",
"username": "john"
}
How can I achieve this?
firestoreandangularfire2, you can using this: github.com/angular/angularfire2/blob/master/docs/firestore/… | if you're usingfirebase, you can apply this solution (github.com/angular/angularfire2/blob/master/docs/rtdb/…) with promise.all or observable combination operator like combineLatest, zip, etcuserstable, the code will look like this: jsbin.com/sunitojaho/edit?js