In this tutorial you will learn How to use jQuery with Angular.

Install the dependency

NPM is used in this tutorial, so install the jquery dependency like the following :

Add the jquery script

You can either add the script directly in the index.html file (not recommended) or if you are working with Angular-cli, add the relative path to jquery in the angular.json file.

  • angular.json

Use jquery

You can then use jquery lile below :

  • app.component.html
  • app.component.ts
That’s it.


The tutorial source code is available on Github. Download the source

References