Angular has always been a scary framework if you use angular-cli and import jquery in angular 6, then you can include jQuery in a very few and easy steps
First install jQuery using npm as follows
npm install jquery — save
Second, go to the ./angular-cli.json file at the root of your Angular CLI project folder, and find the scripts: [] property, and include the path to jQuery as follows:
"scripts": [ "../node_modules/jquery/dist/jquery.min.js" ]
Now to use jQuery, all you have to do is to import it as follows in whatever component you want to use jQuery.
import * from 'jquery';
Question and answer is powered by AnsPress.io