I'm struggling to access this kendo-switch ID (in this case it should be A1) being passed to the generateSubscriptionArray function it seems to return undefined no matter what variation of attempts to access it I try, it also doesn't seem to show up on the $event if I try to pass this to the function.
Any assistance regarding this would be really beneficial the switch is returning the relevant true/false boolean
HTML
<kendo-switch
onLabel=" "
offLabel=" "
formControlName="A1"
id="A1"
(click)="generateSubscriptionArray(userPreferenceForm.controls.A1.value,
formcontrol id as string in this case A1 should be passed here)"
></kendo-switch>
TypeScript:
exportclass UserPreferencesComponent implements OnInit {
userPreferenceForm: FormGroup;
email_address: FormControl;
constructor() {}
ngOnInit(): void {
this.userPreferenceForm = new FormGroup({
email_address: new FormControl('', Validators.required),
A1: new FormControl(false),
});
}
generateSubscriptionArray = (subscription: boolean, alertID: string): void => {
if (subscription === true) {
console.log(subscription, alertID);
} else {
console.log(subscription, alertID);
}
};