Hi I am using mindmap and I am trying yo run a services but I can not find the way:
loadData() {
this.diagram = new dhx.Diagram(this.containerDiagram.nativeElement, {
select: true,
type: “mindmap”,
typeConfig: {
direction: “right”,
},
});
this.nodeSrv.getNodeJsonByProjectId(this.project_id).subscribe((nodes) => {
this.data = nodes;
nodes.forEach((element) => {
if (element.parent == "0") {
delete element.parent;
}
});
this.diagram.data.parse(this.data)
this.diagram.events.on("shapeClick", function (id) {
this.eventEmitterService.onNodeEditComponentClick(); // this event is never fired I tried adding the listener by my selft but did not work, I can not see the context of the componenet inside this function
alert('An item "' + this.data.getItem(id).text + '" is clicked');
});
this.isLoading = false;
});
}