2
http api에 대해 두 가지 관찰 가능한 작업이 있습니다.
하나는 장소를 요청하고 두 번째는 이벤트를 요청합니다.각도 2 중첩 관측 루프
:
place_id => events_arr
을 내 코드
<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>
내 문제가 관찰 placesData
이 eventsData
보다 더 빠르다는 것을 보여줍니다, 그래서 eventsData[place.id]
다음과 같은 예외가 발생 :
TypeError: Cannot read property '12' of undefined
그럴 생각이야?
빠른 작은 해킹 '<이온 슬라이드 * ngIf = "eventsData"> ...'? – mickdev