Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

ngFor click

$
0
0

@zb0t wrote:

I'm sure the answer is incredibly simple.

A boiled down example of my issue is having the following action applying to all "item"s in items, not just the one clicked.

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

In my constructor:

this.isHidden = false;

hide() {
this.isHidden = !this.isHidden;
}

When I click the button, all images are hiding from all "item"s.

Any help is appreciated.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles



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