onKeyUp method

  1. @HostListener('keyup')
void onKeyUp (
  1. dynamic event
)
@HostListener('keyup')

Implementation

@HostListener('keyup')
void onKeyUp(final event) {
  if (event is KeyboardEvent) {
    if (event.keyCode == KeyCode.ENTER) {
      _valChanged.add(_host.value);
    } else if (event.keyCode == KeyCode.ESC) {
      _host.value = _oldValue;
    }
  }
}