Tuesday, July 16, 2024

How to run jQuery in Angular 6?

Run jQuery in Angular 6 - The Rich Post

Hello to all, welcome to In this post, I will tell you, How to run jQuery in Angular 6?

Angular is growing very fastly and popular as single page application. Today I am working with Angular 6 and wanted to run some jquery methods and I succeed and I am sharing that tricks what I did on my app.

Here are the following steps to run or include jQuery into your Angular 6 app:

1. First you need to run below command into your terminal:
  $ npm install jquery --save
2. Add below jquery file path into your angular.json file:
"scripts": ["node_modules/jquery/dist/jquery.js"]
3. Import jquery file into your app.module.ts file:
import * as $ from 'jquery';
4. Declare and finally add jquery code into your app.component.ts file:
declare var $: any;

export class AppComponent {

  ngOnInit() {




And you are done.


If you have any query related to this post then you can ask question or comment below.

the authortherichpost
Hello to all. Welcome to Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 14, Angular 15, Angular 16, Angular 17, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.