Angular2, HostListener, how can I target an element? can I target based on class?

后端 未结 8 1146
后悔当初
后悔当初 2020-12-05 01:50

In Angular2, how can I target an element within the HostListener decorator?

@HostListener(\'dragstart\', [\'$event\'])
    onDragStart(ev:Event) {
        co         


        
8条回答
  •  一生所求
    2020-12-05 02:48

    @HostListener() only supports window, document, and body as global event targets, otherwise it only supports the components host element.

提交回复
热议问题