• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
seegatesite header

Seegatesite.com

Seegatesite.com - Programming Tutorial , Sharing , How and Learn Together

  • TOOLS
    • Bootstrap Navbar Online Generator
    • Customize Sidebar Menu Bootstrap 3
    • Bootstrap Demo
  • ADVERTISE
  • CATEGORIES
    • Android
    • Blogging Tips
    • Database
    • CSS
    • Info Gadget
    • Javascript
    • Linux
    • PHP
    • Various
    • WordPress
  • Q&A
  • PHP
  • JAVASCRIPT
  • JQUERY
  • ANGULAR
  • WORDPRESS
  • SEO
  • REACT
🏠 » Javascript » Tutorial How To Integrate Angular 4 + Bootstrap 3 For Beginners

Tutorial How To Integrate Angular 4 + Bootstrap 3 For Beginners

By Sigit Prasetya Nugroho ∙ October 24, 2017 ∙ Javascript ∙ Leave a Comment

Share : TwitterFacebookTelegramWhatsapp

Tutorial combines Angular 4 with bootstrap v.3.3.7. Bootstrap is an essential role in creating mobile applications. In addition to being easy to use, Bootstrap is also compatible with a variety of frameworks including the javascript framework. In Angular 4, how to integrate Bootstrap into the Angular project is slightly different. Follow the following tutorial.

Read another article: Simple Login Form Angular 4 Tutorial For Beginner

I am sure you have understood what is angular 4 and what is the bootstrap framework. Without further explanation, I will immediately create a simple project to combine the two frameworks.

How To Integrated Angular 4 And Bootstrap 3 Tutorial Min

Table of Contents

  • 1 How to integrate angular 4 project with Bootstrap framework
    • 1.1 So my short tutorial on How To Integrate Angular 4 + Bootstrap 3 For Beginners

How to integrate angular 4 project with Bootstrap framework

1. Create a new Angular project using angular-cli.

Angular-CLI is a generator for Angular 2 and 4 projects (and above). By using this Angular-CLI help, we no longer need to setup many basic needs such as folder composition, how to run, how to build and others

Make sure you have installed angular-cli (read: how to install angular-cli) and run the following code

Related Articles :

  • Trick To Redirect New Window Or Tab With Post Method On Angular 5
  • Tutorial To Change Date Format Ng-bootstrap Datepicker Angular 5
  • Tutorial Simple CRUD Angular 5 And Lumen 5.6 For Beginners

1
ng new angularbootstrap

2. Install Bootstrap v.3.3.7 and Jquery using npm

1
npm install bootstrap@3 jquery --save

3. Integrate Bootstrap and Jquery into the Angular project.

Open the .angular-cli.json file and add the following code in the styles and scripts section

1
2
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css"

and add the following code in the scripts section

1
2
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"

So it will look like the following picture

Tutorial Angular 4 Bootstrap And Jquery

Up to this point, the Bootstrap and Jquery installations into the Angular 4 project have been completed. Here I will try to add a starter template to test whether the Bootstrap framework above has been running correctly.

Edit index.html in the src folder and add the following script above the element

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Project name</a>
          </div>
          <div id="navbar" class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
              <li class="active"><a href="#">Home</a></li>
              <li><a href="#about">About</a></li>
              <li><a href="#contact">Contact</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </nav>

Then change the html code in app.component.html and copy the following code

1
2
3
4
5
6
7
8
<div class="container">
    
          <div class="starter-template">
            <h1>Bootstrap starter template</h1>
            <p class="lead">Use this document as a way to quickly start any new project.<br> All you get is this text and a mostly barebones HTML document.</p>
          </div>
    
        </div><!-- /.container -->

Please test your Angular project if Bootstrap is running well with the command ng serve to run the angular server.

Please check the result via browser

localhost:4200

If successful then the result will be like the following gif

Angular 4 Bootstrap Integration Tutorial

Read: Tutorial Create Angular 4 Currency Format Directive For Textbox

So my short tutorial on How To Integrate Angular 4 + Bootstrap 3 For Beginners

Another Javascript Related Post :

  • Adept Using Datatables Plugin In 10 Minutes For Beginners (Tutorial)
  • The Using Of Reactstrap And React-Table, Suitable For Beginners
  • Tutorial Create Simple Block UI Using React JS
  • How To Implement Login Page And Protected Route ReactJS
  • Complete Tutorial React Router Dom For Beginners (Easy-To-Understand)
  • The Right Way Understanding React Lifecycle For Beginners

Avatar for Sigit Prasetya Nugroho

About Sigit Prasetya Nugroho

This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Reader Interactions

Leave a Reply Cancel reply

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

Time limit is exhausted. Please reload CAPTCHA.

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

Primary Sidebar

Welcome to my Home,

Avatar for Sigit Prasetya NugrohoThis site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.



Popular Articles

Checked checkbox AdminLTE Bootstrap in Jquery

November 4, 2014 By Sigit Prasetya Nugroho 7 Comments

Simple create date format validation with jqueryUI

December 21, 2014 By Sigit Prasetya Nugroho Leave a Comment

Create Simple Progress Bar for Fake Online Generator with Jquery

January 10, 2015 By Sigit Prasetya Nugroho Leave a Comment

22+ Coolest Free Jquery Plugin For Premium Theme

October 3, 2015 By Sigit Prasetya Nugroho Leave a Comment

Easy Build Your Anti Copy Paste Plugin

October 6, 2015 By Sigit Prasetya Nugroho Leave a Comment

Popular Tags

adminlte (15) adsense (13) adsense tips (4) affiliate amazon (13) amazon (12) Android (8) angular (16) angular 4 (12) angular 5 (4) asin grabber (3) Bootstrap (27) codeigniter (5) create wordpress theme (5) crud (8) css (6) free wordpress theme (7) google adsense (4) imacros (4) increase traffic (6) jquery (34) laravel (10) laravel 5 (5) learn android (5) modal dialog (5) mysql (6) nodeJs (4) optimize seo (4) pdo (6) php (30) plugin (53) pos (7) Publisher Tips (5) react (3) Reactjs (7) SEO (37) theme (17) tutorial angular (5) tutorial angular 4 (6) tutorial javascript (10) tutorial javascript beginners (4) twitter (3) widget (3) wordpress (18) wordpress plugin (13) XMLRPC (5)




  • About
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

©2021 Seegatesite.com