Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

ngFor click

$
0
0

All of the items are referencing the same 'isHidden' value, so when you change it for one it changes for all. I'd so something like this:

<ion-card *ngFor="#item of items">
<img src="https://placehold.it/500x300" [hidden]="item.hidden" />
<button (click)="item.hidden = !item.hidden">Hide img</button>
</ion-card>

I haven't tested that at all but it should be pretty close to the mark.


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>