在IE和Mozila中,禁用字段后HostListener不会触发

时间:2019-04-05 11:40:38

标签: angular

当该字段被禁用时,hostlistener不仅不会在IE和Mozila中被触发,而是在Chrome中可以正常工作。

heroes.component.html

<input  placeholder="name" disabled/>

heroes.component.ts

  @HostListener('click', ['$event'])
  onClick(event): void {
  console.log("Hello")
  }

我希望控制台中的输出在mozilla和IE中为Hello,但不会输出。

0 个答案:

没有答案