I need to join the information of the tournament with the information about all the matches which are inside this tournament.
inside tournament I have the id's of the matches.
10g8ha61v8j67mgx19uik3g89: true
10sq64r1k6wdsr2j6s46ox0ix: true
I am doing it like this, but the problem is that I want to have for the field tournament.upcoming FirebaseListObservables and not a simple array of FirebaseObjectsObservables.
this.tournaments = this.af.database.list('https://something.firebaseio.com/soccer/tournaments')
.map((_tournaments) => {
return _tournaments.map((tournament) => {
const self = this;
if (tournament.matches.upcoming) {
Object.keys(tournament.matches.upcoming).map(function (key, index) {
if (!tournament.upcoming) {
tournament.upcoming = [];
}
if (key) {
if (index < 5) {
tournament.upcoming[key] = self.af.database.object(`https://something.firebaseio.com/soccer/matches/${key}`);
}
}
});
}
return tournament;
})
});
And in the client I want to be able to do something like this.
<template [ngIf]="(tournaments | async)?.length">
<ion-list-header class="main-heading"><strong>Upcoming</strong> games</ion-list-header>
<ion-list *ngFor="let tournament of tournaments | async">
<ion-item *ngFor="let match of tournament.upcoming"></ion-item>
<ion-list>
</template>
Hi @alexandrzavalii!
We have a policy to close issues that do not follow the issue template. Feel free to create a new issue that follows the format.
Most helpful comment
Hi @alexandrzavalii!
We have a policy to close issues that do not follow the issue template. Feel free to create a new issue that follows the format.