I searched and I still could not get the right answer. I will be happy that you will point me in the right direction.
I have a database with users and projects
pojects:
08177a0acb3f4d96f8cb5fa19002d2ed:
pid: 08177a0acb3f4d96f8cb5fa19002d2ed,
pName: "Prject 1"
uId: "254",
createdAt: 9377476
users:
254:
userName: "Eric"
uId: "254"
avatar: "image.jpg"
Now I want to display my projects, I get a list in my service
this.projectList = this.af.database.list('projects', {
query: {
orderByChild: 'createdAt'
}
});
getProjects() {
return this.projectList.map(snapshot => {
return snapshot;
});
and I subscribe to component.ts
this.projectService.getProjects()
.subscribe(projects => this.projects = projects);
What I want to do is get userName from users and display it with projects.
How can I use the uId field in projects to retrieve user information in a user list into a single list so that I can display ie {{project.userName}} {{project.avatar}}?
source
share