angular add bootstrap
To add Bootstrap to an Angular project, follow these steps:
Install Bootstrap using npm by running the following command in your terminal:
npm install bootstrap
Open the
angular.json
file in your project's root directory.Locate the
"styles"
array inside thebuild
andtest
options.Add the path to the Bootstrap CSS file to the
"styles"
array. The path should be relative to thenode_modules
directory. For example:json "styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.css" ],
Save the
angular.json
file.If you want to use Bootstrap JavaScript components, you can also add the Bootstrap JavaScript file to the
"scripts"
array in theangular.json
file. For example:json "scripts": [ "node_modules/bootstrap/dist/js/bootstrap.min.js" ],
That's it! Now you have successfully added Bootstrap to your Angular project. You can start using Bootstrap classes and components in your Angular templates.