0
<input #myInput (keyup)="0">

<p>{{myInput.value}}</p>

why that keyup event updates the myInput.value ? What the logic that makes this happen?

vitorfigm
  • 13
  • 1
  • Does this answer your question? [Angular2 - Keyup require a clarification](https://stackoverflow.com/questions/36001757/angular2-keyup-require-a-clarification) – StefanK Dec 23 '20 at 15:48

2 Answers2

0

You have to bind to an event so that the binding/screen is updated. Thus, (keyup)="0" is a shortcut to update bindings on keyup.

See in the official docs: https://angular.io/guide/user-input

StefanK
  • 97
  • 3
  • 11
0

the #myInput creates a template reference and hence {{myInput.value}} gives the value of the input element