Giter VIP home page Giter VIP logo

Comments (5)

Diana-Dubov avatar Diana-Dubov commented on September 16, 2024

I think I am facing the same issue - details below.
Did you by chance found a workaround?

Issue description:
I updated bpmn-js version to "bpmn-js": "^2.0.1" and at runtime seeing the following error:
AppComponent_Host.ngfactory.js? [sm]:1 ERROR TypeError: bpmn_js_1.Modeler is not a constructor
at AppComponent.ngOnInit (app.component.ts:70)
at checkAndUpdateDirectiveInline (core.js:12369)
at checkAndUpdateNodeInline (core.js:13893)
at checkAndUpdateNode (core.js:13836)
at debugCheckAndUpdateNode (core.js:14729)
at debugCheckDirectivesFn (core.js:14670)
at Object.eval [as updateDirectives] (AppComponent_Host.ngfactory.js? [sm]:1)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:14655)
at checkAndUpdateView (core.js:13802)
at callWithDebugContext (core.js:15056)

from angular-bpmn.

GeorgiyZhuravlev avatar GeorgiyZhuravlev commented on September 16, 2024

@Diana-Dubov

Did you by chance found a workaround?

For this repo - no. But I've created new angular app with cli (6) and was able to add modeler (and both types of bpmn-js viewers if you want) just by importing BpmnModeler

import BpmnModeler from 'bpmn-js/lib/Modeler';

export class BpmnModelerComponent implements OnInit {
  modeler: BpmnModeler;
  ...

  ngOnInit() {
    this.modeler = new BpmnModeler({
      container: '#canvas'
    });
    this.modeler.importXML(initialDiagram, err => {
      if (!err) {
        this.modeler.get('canvas').zoom('fit-viewport');
      } else {
        console.error('something went wrong:', err);
      }
    });
  }

}

I use scss for my apps so these two lines were added to src/styles.scss

@import "~bpmn-js/dist/assets/diagram-js.css";
@import "~bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";

That's all (+ npm i bpmn-js --save of course)

from angular-bpmn.

Diana-Dubov avatar Diana-Dubov commented on September 16, 2024

Thanks a lot for the info.
I actually procees with Narve's code and found solution for the issue.
In the latest bpmn-js there were updated export signature of several methods, so the import syntax should be update to:
bpmn-js.ts ::
import _Modeler from 'bpmn-js/lib/Modeler.js';
import * as _PropertiesPanelModule from 'bpmn-js-properties-panel';
import * as _BpmnPropertiesProvider from 'bpmn-js-properties-panel/lib/provider/bpmn';
import * as _EntryFactory from 'bpmn-js-properties-panel/lib/factory/EntryFactory.js';
import _PaletteProvider from 'bpmn-js/lib/features/palette/PaletteProvider.js';

from angular-bpmn.

Diana-Dubov avatar Diana-Dubov commented on September 16, 2024

Did you try by chance to implement CustomRenderer for your Angular app?
I can't make it working.

from angular-bpmn.

narve avatar narve commented on September 16, 2024

Thanks for your input. I will update to latest bpmn-js and commit. Next time, a pull request would be welcome :)

from angular-bpmn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.