由于某种原因,当我遍历数组时,结果变得不确定。该数组是将FIRESTORE QUERY传递给函数的结果。我不知道是什么原因引起的。
这里有一些代码片段,我省略了一些不必要的细节。
<ion-col *ngFor="let deck of decks" class="ion-text-center">
<ion-label>{{ deck.title }}</ion-label>
<ion-row *ngIf="currentDeck">
<app-card-toggle *ngFor="let card of deck.cards" [isInCurrentDeck]="isInDeck(card, currentDeck)"
[cardData]="card" (toggleEvent)="modifyDeck($event)">
</app-card-toggle>
</ion-row>
</ion-col>
partitionDecks(decks: Deck[]) {
console.log(decks);
console.log(decks[0]);
...