在 BPMN.js 中,$inject 属性通常用于声明依赖注入的模块列表。这些模块会在创建对象实例时由依赖注入框架(如 AngularJS)提供。以下是在 BPMN.js 中常见的一些 $inject 属性:
BpmnModeler构造函数的$inject:
BpmnModeler.$inject = ['eventBus', 'canvas', /* ... other dependencies ... */];
BpmnModeler 是 BPMN 模型编辑器的主要构造函数。在实例化 BpmnModeler 对象时,这些依赖将被注入。
ElementFactory构造函数的$inject:
ElementFactory.$inject = ['eventBus', /* ... other dependencies ... */];
ElementFactory 用于创建 BPMN 元素的工厂。在实例化 ElementFactory 对象时,这些依赖将被注入。
ContextPadProvider构造函数的$inject:
ContextPadProvider.$inject = ['config.contextPad', 'injector', 'contextPad', 'modeling', 'elementFactory', 'connect', 'create', 'translate', 'canvas', 'popupMenu'];
ContextPadProvider 是 BPMN 模型中右键上下文菜单的提供者。在实例化 ContextPadProvider 对象时,这些依赖将被注入。
PaletteProvider构造函数的$inject:
PaletteProvider.$inject = ['palette', 'create', 'elementFactory', 'handTool', 'lassoTool', 'spaceTool', 'globalConnect', 'translate'];
PaletteProvider 是 BPMN 模型中的调色板提供者。在实例化 PaletteProvider 对象时,这些依赖将被注入。
这些例子只是展示了一些 BPMN.js 中可能用到的构造函数的 $inject 属性。具体的依赖注入列表可能因库的不同而有所变化。
右侧赞助一下 代码改变世界一块二块也是爱
浙公网安备 33010602011771号