Angular - Is there list of HostListener-Events?

后端 未结 5 705
鱼传尺愫
鱼传尺愫 2020-12-23 12:28

I am using a hostlistener in a directive to detect \"blur\"- and \"keyup\"-events. Now I need to detect changes in the input-element the directive sits on. I tried

5条回答
  •  臣服心动
    2020-12-23 13:16

    I wanted an answer showing all the ones like this:
    document:keydown.escape

    within the context of this kind of snippet in Angular:

    import { HostListener}    from '@angular/core';
    @HostListener('document:keydown.escape', ['$event']) 
      onKeydownHandler(event: KeyboardEvent) {
    
      }
    
    1. This website gave a few examples.
    2. Here is a more complete list.
    3. Here is a more generic overview of the alternatives.

提交回复
热议问题