I have a list of names from the database that I need to display. Each name should have a toggle button associated with it, and when toggled, the value should be posted back to the database. How can I achieve this functionality in an Ionic application while reading the toggle values dynamically based on their respective IDs?
stud.html
<ion-item *ngFor="let student of getStudentList">
<ion-label>{{student.Student_FirstName}}</ion-label>
<ion-toggle [(ngModel)]="student.isChecked" (ionChange)="changeToggle(student)"></ion-toggle>
</ion-item>
stud.ts
changeToggle(selectedStudent) {
console.log(selectedStudent.Student_FirstName + " is checked");
}