I would like to render nested *ngFor
with data coming from Firebase using angularFire2.
So my data are structured like this :
and I want to use the first level of subjects
list in a first *ngFor
and the child level in a nested *ngFor
.
<ion-list>
<ion-item *ngFor="let mainSubject of subjects | async">
{{mainSubject.name}}
<ion-list>
<ion-item *ngFor="let childSubject of mainSubject.subjects | async">
{{childSubject.name}}
</ion-item>
</ion-list>
</ion-item>
</ion-list>
I think I have to use the map operator from rxjs to transform the list to what I need.
Something like this :
this.db.list(`${this.mainSubjectsPath}`).map((value) => {
console.log(value);
// make some transformation...
});
but the map function is never called.
Any idea of how I can do that?
Thanks!