From the course: Learning the Angular CLI

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Adding JavaScript libraries

Solution: Adding JavaScript libraries - Angular Tutorial

From the course: Learning the Angular CLI

Start my 1-month free trial

Solution: Adding JavaScript libraries

(upbeat music) - [Instructor] Let's take a look again at the angular.json file and now at the script array. Any file placed here will be added to your application's global scope, similar to loading the file using a script tag. The particles.JS libraries on NPM. So let's first install it and NPM install particles.JS. Let's inspect the node modules under particles.JS. And let's go ahead and list the files here. And we see that the script that we need is that the root named particles.JS. Let's go ahead and not this path to our scripts array. This will be at /node, modules/particles.JS/particles.JS. Let's use this library now to add a particle animation to our application. The particles.JS library uses the configuration file. Go ahead and grab this file from the exercise files for this video and drag it to the assets folder Head over now to the app.component.HTML file and this go ahead and add a div with an ID of particles…

Contents