Quantcast
Viewing all articles
Browse latest Browse all 229903

ngFor click

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 229903

Trending Articles



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