Reputation: 737
Have an angular4 application packed with Webpack.
want to use cytoscape.js. Need to use npm module for this: https://www.npmjs.com/package/ng2-cytoscape
I have done changes as in that page , only with a difference
import {NgCytoscapeModule} from "ng2-cytoscape";
instead of "ng2-cytoscape/dist"; (which was giving compilation errors)
Then added the following lines to app.module.ts
import {NgCytoscapeModule} from 'ng2-cytoscape';
@NgModule({
imports: [
NgCytoscapeModule
],
Also , added the dependency to the package.json
"dependencies": {
"ng2-cytoscape": "^0.2.0",
}
This gives the following error:
compiler.es5.js:1540 Uncaught Error: Unexpected value 'NgCytoscapeModule' imported by the module 'AppModule'. Please add a @NgModule annotation.
at syntaxError (compiler.es5.js:1540)
What is the reason? Is there another way to use cytoscape.js in Angular 2 - Typescript ?
Upvotes: 1
Views: 1511
Reputation: 12242
Cytoscape does not have an official support package for Angular. If you want to use Cytoscape, use the official cytoscape
package and write your own Angular integration that suits your needs.
Upvotes: 2