I would like to know how to get the value from an input on angular 4. I looked over the documentation on angular and the example with the key event doesn't work very well for me and I can't find a proper example how to do this so please help me out
The problem: I try to read the input's value and after submiting the value to another component that will add the value to a select tag(e.g. send the name of the person to a list for a select tag)
You can also use template reference variables
If you dont want to use two way data binding. You can do this.
In HTML
In component
I think you were planning to use Angular template reference variable based on your html template.
You can use
(keyup)
or(change)
events, see example below:in HTML:
Or
in Component:
html
ts