Angular Quick Tip: Binding Specific Keys to the Keyup and Keydown Events code example
Example: Angular Quick Tip: Binding Specific Keys to the Keyup and Keydown Events
<input (keydown)="onKeydown($event)">
onKeydown(event) {
if (event.key === "Enter") {
console.log(event);
}
}