-2

I have this code

  <input [(ngModel)]="search.Name" type="text" class="form-control" (keydown)="search()" 
  maxlength="40" placeholder="Search">  

when i change the data in textfield then it is working but when i copy paste the value in textfield it does not show any record, copy paste is not working with keydown event

I have tried with (ngModelChange) but the same issue.

user3653474
  • 3,393
  • 6
  • 49
  • 135

1 Answers1

0

Try using the "Input" event instead of "keydown"

<input [(ngModel)]="search.Name" type="text" class="form-control" (input)="search()" maxlength="40" placeholder="Search">
Miri Gold
  • 370
  • 1
  • 9