Ion-toggle in loop


#1

how i can get a specific ion-toggle state (true/false) from loop of toggle.

code:

<ion-card *ngFor= “let item of objectData;let k=index;” >
<ion-card-content (click)=“showmore(k);” id="{{k}}" style=“display: block”>

<ion-toggle [(ngModel)]=“idcheck[k]” (ionChange)=“updateItemarrivals(idcheck)” style=“padding:5px;float: right”>


#2

Hi

<ion-card *ngFor= “let item of objectDataList” >
<ion-card-content (click)=“showmore(item)” style=“display: block”>

<ion-toggle [(ngModel)]=“item.togglestate” style=“padding:5px;float: right”>
</ion-card-content>
</ion-card>

Assure item has property togglestate defined.

Regards

Tom


#3

sorry, togglestate proprty i didn’t understand


#4

Hi

Please provide code of the component (ts file) using the template so I can respond

Regards

Tom