so i’m trying to import these librarys in my ionic app, i followed these steps.
- install dependences
npm install mathjs
npm i d3@3 function-plot
npm install d3
- then i created my custom copy config and add my files
![imagen](https://global.discourse-cdn.com/ionicframework/original/3X/5/3/53a13a5962a35ebebe5cfc881af3efc91085f6cf.png)
3.and in my html inside the head i add the link like this
![imagen](https://global.discourse-cdn.com/ionicframework/original/3X/6/9/69e145937f7db2fabcc3fc910be77a1c49355950.png)
and still doesn’t work
…
That’s good but copy the files to → dest: ‘{{WWW}}’ as your not ‘building’ them!
In your index.html
:
<!doctype html>
<html lang="en" dir="ltr">
<head>
...
<script src="math.js" type="text/javascript"></script>
</head>
<body>
<script>
// do math stuff
</script>
<!-- Ionic's root component and where the app will load -->
<ion-app></ion-app>
<!-- The polyfills js is generated during the build process -->
<script src="build/polyfills.js"></script>
<!-- The vendor js is generated during the build process
It contains all of the dependencies in node_modules -->
<script src="build/vendor.js"></script>
<!-- The main bundle js is generated during the build process -->
<script src="build/main.js"></script>
<!-- Styles -->
<link rel="preload" href="build/main.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="build/main.css"></noscript>
<noscript>
<h2 style="padding: 20px; text-align: center;">JavaScript must be enabled to use this application.</h2>
</noscript>
</body>
</html>
Note: You should create a Service and load your .js files asynchronously: angular - How to load google maps api asynchronously in Angular2 - Stack Overflow