Open utterances-bot opened 8 months ago
Not sure if you read these comments since the post is a bit older, but your preferred solution sadly does not work (anymore).
The inputEvent.detail.value
always returns on
.
I've console.log(inputEvent.detail)
and noticed there is a checked
variable, but when trying to use this I get another error: "Property 'checked' does not exist on type 'InputChangeEventDetail'"
I did find another solution however,which I'll leave here for other who might encounter this post:
import { CheckboxChangeEventDetail } from '@ionic/angular';
onInputChange(inputEvent: CustomEvent<CheckboxChangeEventDetail>) {
console.log(inputEvent.detail.value);
}
Edit, it should be :
inputEvent.detail.checked;
instead of
inputEvent.detail.value;
to get the toggle value.
Custom event types in Ionic | Damir's Corner
https://www.damirscorner.com/blog/posts/20220211-CustomEventTypesInIonic.html