Closed FredBesterwitch closed 4 years ago
Hi @FredBesterwitch!,
Do you install via npm install --save-dev mxgraph-type-definitions
? npm package is not perfect at present, please use git submodule, you can fork this project first, then add as a submodule in your project, I am currently using this method, working on Angular
git submodule add https://github.com/hungtcs/mxgraph-type-definitions.git src/types/mxgraph-type-definitions
If you find some types missing, you can modify your submodule and push to your fork, and then make a pull request.
Thanks for your quick response, i did using npm I will try using as a sub module Just put it in a folder under the app and use the import?
@FredBesterwitch mxGraph is not support es module, you can't import it.Here is a simple example https://github.com/hungtcs/angular-with-mxgraph
Thank You , much appreciated
very glad if this helped.
Can't run the sample you sent, is there something i'm missing? Thanks
ERROR in src/app/app.component.ts:9:18 - error TS2304: Cannot find name 'mxGraph'.
9 private graph: mxGraph;
src/app/app.component.ts:15:22 - error TS2304: Cannot find name 'mxGraph'.
15 this.graph = new mxGraph(this.container.nativeElement);
@FredBesterwitch please check the src/types/mxgraph-type-definitions
folder, is it empty?
clone with --recursive
or exec git submodule init && git submodule update
Hello guys just in case, I would like to let you know that some wrapper exist around mxGraph to adress integration issues
According to https://github.com/asual/mxgraph-factory/issues/9#issuecomment-613234148
The main goal of this project was to provide the required Webpack configuration that turns mxGraph into a CommonJS compatible package. The type definitions were added just for convenience and can be easily dropped if there is a better alternative.
The above wrapper is not using the @hungtcs type definitions lib
@FredBesterwitch @hungtcs this repo which is also using Angular with mxgraph-type-definitions (via npm deps) may be interesting for you: https://github.com/ivamax9/angular-mxgraph-demo
Hi Thanks for create these types for mxgraph, much appreciated. You have done a good job..
It works perfectly in ng serve in dev, but when we deploy the buuild that was generated by ng build --prod, it does not work, it says mxGraphModel does not exist
any help would be appreciated..
Thank You