【发布时间】:2019-08-15 02:08:13
【问题描述】:
我有一个显示卡的 ngFor。当我点击任何一张卡片时,我想显示我点击的卡片的完整信息
我试过这个:
private showDetailCard = false;
expandCard() {
this.showDetailCard = !this.showDetailCard;
}
但是当我点击其中一个时,它们都打开了。
这是我的 HTML:
<div (click)="expandCard()" *ngFor="let key of cars">
<!-- basic infomation -->
</div>
<div [@expandCard] *ngIf="showDetailCard">
<!-- the rest of information -->
</div>
我该如何解决这个问题?
【问题讨论】: