I have a set of “permissions” for DJ’s on a radio broadcasting channel, some have conditions for example:
History Report - (currently toggled as false)
Listener Statistics - (currently toggled as true)
<ion-item>
<ion-label>History Report</ion-label>
<ion-toggle [(ngModel)]=“data.historyReport”></ion-toggle>
</ion-item>
<ion-item>
<ion-label>Listener Statistics</ion-label>
<ion-toggle [(ngModel)]=“data.listenerStatistics”></ion-toggle>
</ion-item>
Trying to implement this with a basic javascript switch
switch (this.checkPermissions(djPermission.ResourceAccess.FlatPermissions, resourcePermissions.HistoryReport)) {
case true:
this.stationListenerDisabled = true;
break;
default:
this.stationListenerDisabled = false;
break;
}
The switch in this case does the disabling of the toggled items, but my code would be in there to change to toggled states between the items.
If I change History Report to true, I am already disabling Listener Statistics, but I need to change the state to false and back to true if History is false again.
My code is generated by Angular on the Front End side dynamically.
Done with Ionic / Typescript / Javascript
If that makes any sense…
Please any ideas? I have tried targeting child nodes and attribute nodes etc. but it gets nasty after a while.