Angular - Is there list of HostListener-Events?

后端 未结 5 699
鱼传尺愫
鱼传尺愫 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:25

    Open angular dom element schema https://github.com/angular/angular/blob/master/packages/compiler/src/schema/dom_element_schema_registry.ts#L78

    where:

    • (no prefix): property is a string.
    • *: property represents an event.
    • !: property is a boolean.
    • #: property is a number.
    • %: property is an object.

    Then press ctrl+F and write *

    @HostListener(and also (customEvent)="handler()") can also listen to custom events

    Example

提交回复
热议问题