Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4869

How to get input value in TypeScript

$
0
0

Hi guys, 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'
    {{on 'input' this.updateNewItemValue}}
    value={{this.newItem}}
/>

Maybe am I using wrong type for event argument?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4869

Trending Articles