I want ot get all ngfor value in onclick

I want ot get all ngfor value in onclick.
below my html code

 <ion-card *ngFor="let item of items">
   <video width="100%" controls="" poster="assets/imgs/poster.jpg">
  		<source src="{{item._meta_gallery_images}}"  type="video/mp4">
    <ion-col  col-6>
      1 of 2
     <ion-col col-6>
     <ion-icon name="share" class="size" color="share" (click)="shareforall($event , item)"></ion-icon>
     <ion-icon name="download" class="size" (click)="download()"></ion-icon>
     <ion-icon name="logo-facebook" class="size" color="facebook" (click)="facebookShare($event , item)"></ion-icon>
     <ion-icon name="logo-whatsapp" class="size" color="whatsapp" (click)="whatsAppSahre($event , item)"></ion-icon>

Iā€™m trying to take the value in this way
Below my .ts

	public shareforall(event,item){
		let a = item;
       .then(() => {

      .catch(() => {



showing an error value is undefine.
How can i do that please guide me

are you looping json array?
anyway there is no problem in ngFor.Please print items on

and why should you use
 public infront of method shareforall,its not needed ,
remove public infront of that method```
1 Like

Great. now its working fine.Thanks for saving my day

1 Like