keydown shift tab angular

JavaScript
  /**
   * To handle tab key down
   * @param $event object
   */
  onTabPress($event) {
    /*
    Here you will press tab or shift+tab. 
    In both the cases this.isOptionListVisible will be set to false.
    <input
        type="text"
        (keydown)="onTabPress($event)"
        />
    */
    if ($event.key === 'Tab') {
      this.isOptionListVisible = false;
    }
  }
Source

Also in JavaScript: