How do I include javascript+css from node_modules in ionic 2?


#1

I need to include fullcalendar and chart.js within my ionic 2 app. (ionic 2 RC.3) I have used npm to install the relevant modules, and the scripts are within my node_modules folder.
How do I properly include the scripts/css from the node_modules folder into my app?

Things I’ve tried:

  • Manually copy the relevant js/css files into the assets folder, and references them with normal <script> and <link> elements in the index.html. (I mostly got this to work, but it seems terribly clunky)
  • import them in my app.module.ts and/or my custom component.ts files, such as import 'chart.js/dist/Chart.bundle.min.js'; (this sort of works, but I get errors that the underlying scripts can’t find jQuery, so I still have to include jQuery in the index.html manually as above)

Surely there is a better way?