12 April 2020

Install bootstrap in angular project


  • Open command prompt & redirect to angular project folder using below commands
    • E:
    • cd E:\TestProjects\Angular\TestProject1
  • Before installing bootstrap we need to install Jquery & Popper.js as using below commands 
    • npm install jquery --save
    • npm install popper.js --save
  • Now install bootstrap using below command
    • npm install bootstrap --save
  • Now install font-awesome for icons and others using below command
    • npm install font-awesome --save
  • Now we need to add essential CSS files and JavaScript files which are required to execute bootstrap in angular.json file under styles and Scripts section as blow image
 "styles": [
              "src/styles.scss",
              "node_modules/bootstrap/dist/css/bootstrap.css",
              "node_modules/font-awesome/css/font-awesome.css"
            ],
            "scripts": [
              "node_modules/jquery/dist/jquery.js",
              "node_modules/popper.js/dist/umd/popper.js",
              "node_modules/bootstrap/dist/js/bootstrap.js"
            ]

No comments:

Post a Comment