-->
  • How to import bootstrap and jquery to our angular project

    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
  • You might also like