I have one main component and one child
<main>
<child
[nodes]="nodes"
(nodeChanged)="someFunction(output)">
</child>
<main>
Child component renders multilevel tree structure recursively (i.e. it renders itself if there are children) in which every node is clickable, irrespective of it is terminal node or not.
In child component every node has a click event registered "clickedNode()". Now because I don't want my click event to bubble up to clicked node's head I wrote "event.stopPropagation()" in "clickedNode()" function.
@Output() nodeChanged = new EventEmitter<Object>();
clickedNode(selectedNode, e:MouseEvent){
this.nodeChanged.emit(selectedNode);
e.stopPropagation();
}
Now the problem is @output emitter
doesn't if inner level of component gets clicked. It emits only if level one nodes are clicked.