import BpmnModeler from ‘bpmn-js/lib/Modeler’;
import { BpmnPropertiesPanelModule, BpmnPropertiesProviderModule } from ‘bpmn-js-properties-panel’;
import BpmnColorPickerModule from ‘bpmn-js-color-picker’;
This is my HTML;
<div #ref class="diagram-container">
<div #canvas class="canvas" id="js-canvas"></div>
<div class="properties-panel" id="js-properties-panel"></div>
</div>
I have this snippet of code in my .ts file;
ngOnInit(): void {
this.bpmnModeler = new BpmnModeler({
container : ‘#js-canvas’,
propertiesPanel : {
parent : ‘#js-properties-panel’
},
additionalModules : [
BpmnColorPickerModule,
BpmnPropertiesPanelModule,
BpmnPropertiesProviderModule
]
});
}
ngAfterContentInit(): void {
this.bpmnModeler.on(‘import.done’, ({ error }) => {
if (error) {
this.showSnackBar(‘Failed to render diagram’.concat(error), “x”, “info”)
}
else {
this.bpmnModeler.get(‘canvas’).zoom(‘fit-viewport’);
this.bpmnModeler.attachTo(this.elementRef.nativeElement);
}
});
}
This results in the following run-time error in the console;
Note:
- Without the code snippet shown in bold above, the Modeler works showing the Toolbox, Diagram & the Color palette
- Properties panel doesn’t show up.
Please help.