Attempting to retrieve toggle state from the server and update the view accordingly. Below is the HTML code:
<ion-list *ngIf="this.devices.length > 0 " no-padding >
<ion-item *ngFor="let device of this.devices; let i = index">
<ion-label color="light">{{ device.name }} </ion-label>
<ion-toggle (ionChange)="update_state($event,device.ssid)" (ngModel)="device.ssid" color="secondary"></ion-toggle >
</ion-item>
</ion-list>
While it's clear that an ion-toggle
can be bound to an object in the ts file using ngModel
, the question remains on how this will work with dynamically generated toggles?