-
Notifications
You must be signed in to change notification settings - Fork 12k
How to embed "regular" JS-Libs (e.g. Chart.js, dragula.js) in dev & prod built #1015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I was able to get Chart.JS and dragula.js working by declaring it a "global" module in system-config.ts
and importing it in my main-component I don't know if this should be in the docs, since this is an SystemJS issue but it would be great to have it in the "How to install 3rd party libs" section. More information here: |
Heya, glad to know that you got it working! I'll try to add it to the wiki when reviewing the angular2-material example. Meanwhile I might just redirect people here when they have similar issues. Cheers! |
It doesn't work in my case, I used jquery and bootstrap and tried defining the format global but it still not able to recognise them. Finally, I moved them to public folder and used them in index file. Please help if there is another working approach exists |
+1 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
There are a lot of discussions going on regarding the --prod built and how difficult it can be to embed 3rd-Party libraries. So far I have managed to add the following libraries, they run perfectly in dev and prod-built with beta5
I wanted to add ng2-dragula and ng2-charts but each of them rely on a separate JavaScript-Library (chart.js and dragula.js) which I am only able to get up and running in dev-mode and when I add the import to index.html.
When I add them via system-config.js I only get errors. I tried changing the format to cjs or register or just leave it away. But I didn't find a way to add a "regular JS library like "Chart.JS" to the angular-cli project so that it runs in dev and --prod mode.
The text was updated successfully, but these errors were encountered: