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.
-
share your code snippetVenkat.R– Venkat.R2016-12-15 01:15:38 +00:00Commented Dec 15, 2016 at 1: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– Michael McGowan2016-12-15 01:57:02 +00:00Commented Dec 15, 2016 at 1: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– amin892016-12-15 08:03:57 +00:00Commented Dec 15, 2016 at 8:03
Add a comment
|
1 Answer
You can reference this question here, I do not believe it is possible to put a script tag inside of an angular 2 template.
1 Comment
amin89
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?