In collection companies there's a documents with model
company: example
address: nowhere
users:{
123456789:{
email: [email protected]
}
}
where 123456789 is user's id
To get data from documents
this.compColl = this.afs.collection('companies');
this.comp = this.compColl.valueChanges();
To list data in view
<li *ngFor="let cmp of comp | async">{{cmp.company}}</li>
This working for fields company and address but not working for
<li *ngFor="let cmp of comp | async">{{cmp.email}}</li>
How to list users email from this document
email, you need to access two other objects which areusersand123456789which is probably the user ID.<li *ngFor="let user of comp.users | async">{{user.email}}</li>