the keydown in input angular cause previous value code example
Example: how to get mat input value on keyup javascript
<input type="text" class="form-control" (input)="onSearchChange($event.target.value)">
onSearchChange(searchValue: string): void {
console.log(searchValue);
}