Hi,
I am using a ion-slides component like this.
<ion-slides #mySlider effect="slide" (ionSlideDidChange)="slideDidChange()">
<ion-slide *ngFor="let c of cards;">
<ion-card>
<ion-item>
<ion-row no-padding>
<ion-col>
<icon-chip item-left></icon-chip>
</ion-col>
<ion-col>
<ion-thumbnail item-right class="thumbnail">
<img [src]="c.thumbnail"/>
</ion-thumbnail>
</ion-col>
</ion-row>
</ion-item>
<ion-card-content>
<h1 class="last-digits">**** {{ c.lastDigits }}</h1>
<h1 class="card-holder-name">{{ c.cardHolderName }}</h1>
<div class="rectangle-border-bottom-right">
<ion-icon name="star" class="star star-color" [class.default-card]="c.isDefault"></ion-icon>
<div class="triangle-topleft"></div>
</div>
</ion-card-content>
</ion-card>
</ion-slide>
</ion-slides>
When I want to remove a card, I use the next code.
this.cards = this.cards.filter(p => p.cardId !== pm.cardId);
But when I select the last card to remove, all cards are removed.
example
[{cardId: card1} , {cardId: card2}, {cardId: card3}]
this.cards = this.cards.filter(p => p.cardId !== pm.cardId); //Where pm.cardId === card3
so, we have:
this.cards = [{cardId: card1} , {cardId: card2}]
but all card are removed from screen.
help me please!