Install Bootstrap 5 in Angular 14

Install bootstrap 5 in angular 14; Through this tutorial, you will learn how to install and use bootstrap 5 in angular 14 applications.

How to Install Bootstrap 5 in Angular 14

Use the following simple steps to install and use bootstrap 5 in angular 14 applications; as follows:

  • Create Angular 14 App
  • Install Bootstrap 5
  • Configure Bootstrap 5 into Angular App
  • Use Bootstrap 5 in Angular
  • Run Angular App

Create New Angular 14 App

Open your command prompt and execute the following command to install angular 14 app into your system; as follows:

npm install -g @angular/cli

ng new angularbootstrap//Create new Angular Project

cd angularbootstrap

Install Bootstrap 5

Again open your command prompt and navigate to your angular 14 application. Then execute the following command to install bootstrap 5 into angular 14 app; as follows:

npm install bootstrap
npm i @popperjs/core

Configure Bootstrap 5 into Angular App

And navigate to your angular 14 app and open package.json file. And then add the following code into it; as follows:

"styles": [
              ...
              "node_modules/bootstrap/dist/css/bootstrap.min.css"
          ],
"scripts": [
              ...
               "node_modules/bootstrap/dist/js/bootstrap.min.js"
           ]

Use Bootstrap 5 in Angular

Navigate src/app/ directory and open app.component.html file from your angular 14 app. And then add the following code into it; as follows:

<div class="container  text-center mt-5 mb-5">
  <h1>Bootstrap 5 is working fine with Angular 14!!</h1>
</div>

Run Angular App

And then execute the following command on terminal to run your angular application; as follows:

ng serve

Then visit your web browser and hit the following URL into it:

http://localhost:4200

Conclusion

To Install bootstrap 5 in angular 14; Through this tutorial, you have learned how to install and use bootstrap 5 in angular 14 applications.

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

One reply to Install Bootstrap 5 in Angular 14

  1. Hi,

    Apologies for this but your article on step 3. The styles and scripts should not be added to the package.json file but to the angular.json file, as adding this to the angular.json file worked for me and not the package.json.

    Kind regards.

Leave a Reply

Your email address will not be published. Required fields are marked *