I went with the properties panel code example given here: bpmn-js-examples/properties-panel at main · bpmn-io/bpmn-js-examples · GitHub, and made a working codesandbox here: custom-elements-variables-properties-panel - CodeSandbox
However, when I transferred this code into my angular app, I hit a problem manifested in the console error:
I am quite sure that the modeler can’t initialize because it can’t find the element behind the “#properties-panel” reference, since I’m not using jquery in my angular project.
My first attempt to fix this was to change my attachCanvas() wrapper method.
I have wrapped the bpmnJS plugin in an angular service class, and the attachCanvas() method looks like:
public attachCanvas(htmlElement: ElementRef) {
this.bpmnJS.attachTo(htmlElement);
}
so I just changed that to:
public attachCanvas(htmlElement: ElementRef, propertiesPanelParentElement: ElementRef) {
this.propertiesPanelParentElement = propertiesPanelParentElement;
this.bpmnJS.attachTo(htmlElement);
}
and then changed
this.bpmnJS = new Modeler({
additionalModules: [bpmnCustomControls, propertiesPanelModule, propertiesProviderModule],
moddleExtensions: {
camunda: camundaModdleDescriptor,
},
propertiesPanel: {
parent: ‘#properties-panel’,
},
});
to
this.bpmnJS = new Modeler({
additionalModules: [bpmnCustomControls, propertiesPanelModule, propertiesProviderModule],
moddleExtensions: {
camunda: camundaModdleDescriptor,
},
propertiesPanel: {
parent: this.propertiesPanelParentElement,
},
});
and started passing an elementRef for the properties panel the same way I am passing it for the canvas element. This prevented the console error I’ve shown above, but the properties panel is still not being loaded.
Since my solution was guesswork, can you offer a way to pass an element reference that positively works?