I want to know if it's possible to load a script.js into a Typescript html template in angular2? If it's not possible, how can I do and what alternatives I have? In my project, I need to call a dropzone.js script into the template dropzone.component.html. It doesn't work when I load it from this file. So how can I do if I don't want to put the script into index.html?? Thank you.
Asked
Active
Viewed 3,374 times
2
-
share your code snippet – Venkat.R Dec 15 '16 at 01:15
-
1If your script is in a module format (AMD, CommonJS etc.) you can dynamically (lazy) load the script with a module loader such as SystemJS. – Michael McGowan Dec 15 '16 at 01:57
-
I want to use dropzone.js (A library to drag and drop file with upload on server side) into an angular2 project. I have a SPA and I don't want to put the reference to the script in the html page index. What's the alternatives so? – amin89 Dec 15 '16 at 08:03
1 Answers
2
You can reference this question here, I do not believe it is possible to put a script tag inside of an angular 2 template.

Community
- 1
- 1

UofABBallCoder626
- 84
- 1
- 4
-
I want to use dropzone.js (A library to drag and drop file with upload on server side) into an angular2 project. I have a SPA and I don't want to put the reference to the script in the html page index. What's the alternatives so? – amin89 Dec 15 '16 at 08:03