Site Overlay

How to Install and Use jQuery with Angular 9?

Share : Answer for How to Install and Use jQuery with Angular 9?

Step 1 - Install jQuery via NPM

We need to start by installing the jquery library via npm:

Step 2 - Tell Angular About jQuery

Open the angular.json file and the library to scripts array as follows:

Step 3 - Calling jQuery Methods

You can then use jquery methods in your components.

Open the src/app/app.component.ts file and update it as follows: