Angular Application How to Add Event Listener on diagram element

I have Angular Application that implements some functionality of bpmnJS
As for now there’s such diagram:


I am trying to add Event Listener on one of the elements:

ngAfterViewChecked(): void {

//select the end event
var elementRegistry = this.bpmnJS.get("elementRegistry");
if (elementRegistry._elements != null) {
  let element = elementRegistry.get('Activity_1iag6z7');
  element.addEventListener('click', this.onClick.bind(this));
}

}

Element is successfully found
But when I try to AddEventListener I have error like this
image
Can you please tell me, what am I doing wrong?

1 Like

The elements are not HTML elements so addEventListener won’t work. This example should help you: bpmn-js-examples/interaction at master · bpmn-io/bpmn-js-examples · GitHub

Good afternoon, my name is Luis, and I am having the same problem that you asked, sorry for the inconvenience, were you able to resolve the power, add events to an element of the diagram?