Is there a way to disable the input field only when a keydown event occurs, without affecting other input fields?
xyz.component.html
<input type="text" (keydown)="disableInput($event)"> // <-- Disable if keydown
<input type="text" (keydown)="disableInput($event)">
<input type="text" (keydown)="disableInput($event)">
xyz.component.ts
public disableInput(evt) {
if (evt.keyCode === 13 || evt.keyCode === 9) {
evt.target.tagName.disabled = true;
}
}