In order to import jquery and bootstrap frameworks to our angular project. we may use following command via commandline.
Update angular cli
- npm install -g @angular/cli
Import jquery and bootstrap
- npm install bootstrap jquery
If the commands above gave you to permission you can open commandline as right click "Run as Administrator" on windows, add prefix "sudo " in mac
After run commands, then the add paths of jquery and bootstrap as follows in to angular.json file which is located in root of project.
"styles": [
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
Addin info :
When you run code above it will download the latest version of jquery and bootstrap frameworks. If you downgrade the version of them use following commands;
To downgrade or install spesific version of bootstrap :
- npm install bootstrap@3 --save
-
How to import bootstrap and jquery to our angular project
Ekim 22, 2019 0
How to import bootstrap and jquery to our angular projectYunus Emre Ekim 22, 2019
Yunus Emre
Integer sodales turpis id sapien bibendum, ac tempor quam dignissim. Mauris feugiat lobortis dignissim. Aliquam facilisis, velit sit amet sagittis laoreet, urna risus porta nisi, nec fringilla diam leo quis purus.