Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 第四次活动代表团_Angular_Typescript_Event Delegation - Fatal编程技术网

Angular 第四次活动代表团

Angular 第四次活动代表团,angular,typescript,event-delegation,Angular,Typescript,Event Delegation,我需要检测一个伪元素(::after)上的点击事件,该元素在CSS中包含一个图标。此伪元素是HTML元素的同级元素,将打开/切换/显示中的所有 我正在将单击事件传播到父元素,并使用this.selectDropdown.nativeElement.focus()触发上的焦点事件 注:selectDropdown类型ElementRef用@ViewChild('selectDropdown')装饰并放置在中 你们知道吗,伙计们? 非常感谢您的帮助您能否创建一个最小的可复制示例(plunker/JS

我需要检测一个伪元素(::after)上的点击事件,该元素在CSS中包含一个图标。此伪元素是
HTML元素的同级元素,将打开/切换/显示
中的所有

我正在将单击事件传播到父元素,并使用
this.selectDropdown.nativeElement.focus()触发
上的焦点事件

注:
selectDropdown
类型ElementRef用
@ViewChild('selectDropdown')
装饰并放置在

你们知道吗,伙计们?
非常感谢您的帮助

您能否创建一个最小的可复制示例(plunker/JSFIDLE)?它有点粗糙,我不知道您是否可以在您的案例中使用,但使用rxjs fromEvent似乎有效事件已捕获,但未展开。我将提供一个JSFIDLE