Learn Angular

How to add and run bootstrap in angular 10?

Angular Bootstrap

Hello to all, welcome to therichpost.com. In this post, I will tell you, How to add and run bootstrap in angular 10?

Angular 10 came and if you are new in angular then please check below two links for better understanding:

Angular for Beginners

Angular 10 Tutorials

Add bootstrap in angular
Add bootstrap in angular

Here is the code snippet and below follow carefully:

1. Here are the basics commands to install angular 10 on your system:

npm install -g @angular/cli 

ng new angularboot //Create new Angular Project

cd angularboot // Go inside the Angular Project Folder

ng serve --open // Run and Open the Angular Project

http://localhost:4200/ // Working Angular Project Url

 

2. After done with above, you need to run below commands to set bootstrap environment into your angular 10 application:

npm install --save bootstrap

 

3. Now you need to add below code into your angular.json file:

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

 

4. Now you need to add below code into src/app/app.component.html file:

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

 

In the end, don’t forgot to run ng serve command. If you have any query then do comment below.

Jassa

Thank you.

Ajay Malhotra
the authorAjay Malhotra
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know Wordpress, Core php, Angularjs, Angular 2, Angular 6, Angular 7, Angular 8, Angular 9, Angular 10 Nodejs, laravel, Codeigniter, Shopify, Squarespace, Jquery, Google Map Api, Vuejs, Reactjs, Bigcommerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.