0

I am a little new to angular-meteor and want to add an external js library to my project. The library is Fusioncharts.js http://www.fusioncharts.com/angularjs-charts/#/demos/ex1 and it cannot be installed using any of these options 1) bower install 2) npm install 3) meteor add (from atmosphere)

So what i did is, I followed these steps How can I add third-party JavaScript libraries to a Meteor application? and added the libraries manually under public/js directory Created a main.js file and added all the scripts using $.getScript

Strange thing is when I add the dependency of the 'ng-fusioncharts' module in my angular.module it throws an error " Module 'ng-fusioncharts' is not available! You either misspelled the module name or forgot to load it."

Please let me know what could be going wrong here. P.S : When I type in FusionCharts in the console.log I do see that object. So it means the Fusioncharts libraries were imported properly but not added to the angular dependency Thanks in advance

Community
  • 1
  • 1
Gol
  • 19
  • 2

1 Answers1

0

Please note that $.getScript is asynchronous, so you would need a little timeout to wait for the module to be available to the rest of your code.

Another possibility to try out would be to include your script rather in client/compatibility special folder. It will be included in your JS and execute before the rest of your client JS code.

ghybs
  • 47,565
  • 6
  • 74
  • 99
  • I am glad it worked for you. Thank you for the feedback. Please note that the SO way to thank people is also to **accept** the answer that helped you. Once you have enough "reputation", you will also have the ability to "up vote". – ghybs Jul 27 '16 at 02:31
  • Should I be doing the same thing for adding external ".css" files ? – Gol Jul 28 '16 at 20:40