如何在Angular中添加cytoscape扩展名

问题描述 投票:0回答:1

我正在尝试在Angular 8中实现cytoscape扩展

npm安装cytoscape-edge-editingCytoscape工作正常。

1.app.ts

import * as cytoscape from 'cytoscape';
import * as edgeBendEditing from 'cytoscape-edge-editing';
import * as jquery from 'jquery';


let cytoscape = require('cytoscape');
let jquery = require('jquery');
let edgeBendEditing = require('cytoscape-edge-editing');

edgeBendEditing( cytoscape, jquery );
cytoscape.use(edgeBendEditing);
  1. angular.json

     "scripts": [
              "node_modules/cytoscape/dist/cytoscape.min.js",
              "node_modules/cytoscape-edge-editing/cytoscape-edge-editing.js",
              "node_modules/query/dist/jquery.min.js"
            ]

浏览器中的错误如下。

ReferenceError:未定义$ [了解更多]

angular cytoscape.js cytoscape
1个回答
0
投票

我认为“脚本”部分有错字。它应该是“ node_modules / jquery / dist / jquery.min.js”。

© www.soinside.com 2019 - 2024. All rights reserved.