Aniruddha Das
Aniruddha Das

Reputation: 21688

What version of jquery angular 4 holds

I am running into a situation where I need to use jQuery and thought angular 4 might include the same version of jquery as angularJS have a light version of it.

If angular 4 internally have a jquery that what kind of jQuery it have. jQuery lite or full version?

Upvotes: 1

Views: 4776

Answers (2)

msanford
msanford

Reputation: 12227

Angular does not include jQuery; you must include it manually, by, for example:

npm install jquery @types/jquery

This will, at the time of this writing, install 3.2.1.

Then make sure node_modules/jquery/dist/jquery.min.js is included in your build (there are many build workflows so I won't get into the examples).

Then add

 declare const $: JQueryStatic;

after your imports and before your @Component decorator in the components whose templates use jquery.

Upvotes: 4

Reese Davis
Reese Davis

Reputation: 147

Angular (2/4) does not include jQuery at all. However angularjs have jQuery light.

Upvotes: 3

Related Questions