1

I would like to use in one of my components this effect:

https://codepen.io/linrock/pen/Amdhr

my first approach was to try to translate the javascript to typescript, but then I gave up and I decided to copy the js file that you can find in the codepen and try to import it in my application.

Then, I copied the file in src/app/scripts/confetti.js and then I tried to import it in my index.html

<script src="scripts/confetti.js"></script>

But I get that the file confetti.js is not found when I run my app.

Do you know what I am doing wrong?

Manuelarte
  • 1,658
  • 2
  • 28
  • 47
  • https://stackoverflow.com/questions/42478930/how-to-import-javascript-file-into-angular2 – Vega Aug 28 '17 at 10:39
  • Possible duplicate of [Where else can I declare included scripts in angular-cli?](https://stackoverflow.com/questions/45339157/where-else-can-i-declare-included-scripts-in-angular-cli) – angularrocks.com Aug 28 '17 at 10:53

1 Answers1

4

you need to copy your js file to "src/resources/js/" and then include it in your .angular-cli.json

"scripts": [
        "resources/js/confetti.js"
           ],