i am trying to send the value of an input field, on "onClick" of a button event, what's wrong with that?
<input #new_field type="text" />
<button (click)="saveNewField(new_field.value)">Save</button>
saveNewField(new_name) {
// new_name is undefined
}
You have to define value attribute to it, otherwise, it will be recognized as undefined.
<input #new_field type="text" value=""/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With