I noticed that the value of the template variable changes only after the Enter key is pressed or the field is abandoned.

So, is it possible to make it so that it changes at the moment of input?

For example,

<input id="search" type="search" class="form-control" name="search" placeholder="Search" #searchValue/> <div *ngIf="searchValue.value" class="serach-result col-xs-2"> <div *ngFor="let tag of tags">{{tag}}</div> </div> 

the enumeration of elements is displayed after leaving the field, and it is necessary at the moment of entering to display the results.

1 answer 1

Use ngModel

 <input type="search" class="form-control" placeholder="Search" [(ngModel)]="searchValue"> 

https://stackblitz.com/edit/ngmodel