mpx200 / ng-dygraphs

Angular 2+ library for support of dygraphs(http://dygraphs.com) charts
MIT License
3 stars 9 forks source link

Instructions need to include restart of 'ng serve' #26

Open wgtthompson opened 6 years ago

wgtthompson commented 6 years ago

Spent about a day on this wondering why I had followed all directions but couldn't get it to work. I kept getting an error in the JS console in Firefox sayingERROR ReferenceError: Dygraph is not defined. The Dygraph object just showing a spinning bubble wheel in the browser. No amount of searching the internet for combinations of the error message, Angular, Dygraph, ng-dygraphs, etc came anywhere close to a solution. I branched out and started researching how to use an existing JS library within angular and after very careful reading I noticed one little statement that said you need to restart 'ng serve' in order for the modifications to angular.json (angular-cli.json in the instruction) to be picked up.

pierre-fromager commented 5 years ago

As provided in other issue comment I advise to add the following npm packages to your project. @types/dygraphs dygraphs Then in your ts code do the import as below. import Dygraph from 'dygraphs';