how to install bootstrap in angular
To install Bootstrap in Angular, you can follow these steps:
- Open your Angular project in your preferred code editor.
- Open a terminal or command prompt.
- Navigate to the root directory of your Angular project.
- Run the following command to install Bootstrap using npm:
npm install bootstrap
- After the installation is complete, open the
angular.json
file in the root directory of your Angular project. - Locate the
"styles"
array in thearchitect/build/options
section of theangular.json
file. - Add the Bootstrap CSS file path to the
"styles"
array. The default path is:
"node_modules/bootstrap/dist/css/bootstrap.min.css"
Your "styles"
array should now look something like this:
json
"styles": [
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
]
- Save the
angular.json
file. - You have now installed Bootstrap in your Angular project.
You can now use Bootstrap components and styles in your Angular application. Remember to import the necessary Bootstrap components in your Angular components or modules to utilize them effectively.