I have two observable working against http api.
One is asking for places, the second for events.
The one which asks for events returns a hash of:
place_id => events_arr
and my code shows
<ng-container *ngFor="let place of placesData">
<ion-item>
<h1>{{place.name}}</h1>
<ion-slides>
<ng-container *ngFor="let event of eventsData[place.id]">
<ion-slide>
<h1>{{event.title}}</h1>
</ion-slide>
</ng-container>
</ion-slides>
</ion-item>
</ng-container>
My problem is that placesData observable is faster than eventsData , so eventsData[place.id] raises the following exception:
TypeError: Cannot read property '12' of undefined
Any idea?
<ion-slides *ngIf="eventsData">...</ion-slides>?