Hi
I used custom properties panel provider and added to a custom button. I can inject some kind of bpmn-js objects as in example. But another custom object or angular service cannot injectable in provider. Is there any way inject angular object or service?
My project is angular and I found the solution and used in other modules as a injected object.
export class MyLoggingPlugin {
static $inject = ['eventBus', 'dialogService'];
constructor(eventBus: any, dialogService: DialogService) {
console.log('DIALOG', dialogService);
eventBus.on('element.changed', event => {
console.log('Plugin element ', event.element, ' changed');
dialogService.info('Changed');
});
}
}
........................
const LogModule = {
__depends__: [CoreModule],
__init__: ['myLoggingPlugin'],
myLoggingPlugin: ['type', MyLoggingPlugin],
};
this.bpmnJS = new Modeler({
container: '#js-canvas',
propertiesPanel: {
parent: '#js-properties-panel',
},
additionalModules: [
{ dialogService: ['value', this.dialogService] },
LogModule
........
]
});
3 Likes
Thanks for that piece of code, it really brings some light on how does bpmn-js injector work!