d3.js - Import d3js into Ionic2 typescript project -
i cannot wrap head around how can import d3js library in ionic typescript projet. installed library using :
npm install d3 --save-dev
the library in node_modules/d3. in page modules, try import using every possible path, example :
import * d3 'd3/d3' import * d3 '../../../node_modules/d3/d3'
i error:
error ts2307: cannot find module 'd3/d3'. or error ts2307: cannot find module '../../../node_modules/d3/d3'`.
any hint me ?
angular version 2.0.0-rc.1
ionic : 2.0.0-beta.9
thanks
i used workaround issue.
what did :
link d3js in index.html (at end of file, bellow app.bundle.js):
<script src="https://d3js.org/d3.v3.min.js"></script>
then in page.ts (before @component) :
declare var d3: any;
and can use :
d3.select("#graph svg").remove();
so not using import (you should delete import if want use solution)
Comments
Post a Comment