我在html文件中有一个循环
<ion-list *ngIf="this.devices.length > 0 ">
<ion-item *ngFor="let device of this.devices">
<ion-label (click)="goto_device(device.ssid,device.name)"> {{ device.name }} </ion-label>
<ion-toggle (ionChange)="update_state($event,device.ssid)"></ion-toggle >
</ion-item>
</ion-list>
每个ion-toggle
都必须订阅行为主体并相应地更新状态,该如何实现?