mardi 10 mai 2022

How to get input value in TypeScript (ember)?

I am new to Ember, try to make simple todo app by my own after YT tutorial. However I have a problem when I try to access input value.

Property 'value' does not exist on type 'EventTarget'

My function:

updateNewItemValue(event: InputEvent) {
    this.newItem = event!.target.value;
 }

Using it in template:

<input
    type='text'
    
    value=
/>

Maybe am I using wrong type for event argument?




Aucun commentaire:

Enregistrer un commentaire