Solved

Adding Bootstrap 3 to Angular 2 application

Posted on 2016-11-02
4
383 Views
Last Modified: 2016-11-05
Hello there,

I am starting my first Angular 2 application and my basic setup is done. I want to know that how can I add bootstrap css library to my angular 2 project? .

regards
Zolf
0
Comment
Question by:zolf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 57

Expert Comment

by:Julian Hansen
ID: 41869967
Just include it in your index.html page in the <head>
0
 
LVL 13

Assisted Solution

by:F Igor
F Igor earned 250 total points
ID: 41871104
You need to add a local copy of bootstrap library in HEAD section of your page. Download it from
https://github.com/twbs/bootstrap/releases/download/v3.3.7/bootstrap-3.3.7-dist.zip

<!-- Main CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css" >
<!-- Basic Theme -->
<link rel="stylesheet" href="css/bootstrap-theme.min.css" >
<!-- Main JavaScript library -->
<script src="js/bootstrap.min.js" ></script>

Open in new window




Or include directly using bootstrap's CDN
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
<!-- Basic Theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" >
<!-- Main JavaScript library -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" ></script>

Open in new window

0
 
LVL 57

Accepted Solution

by:
Julian Hansen earned 250 total points
ID: 41871231
@F Igor

Not quite correct - if you are going to use the bootstrap components then you should use the Bootstrap Directives for Angular rather than including the bootstrap default JavaScript file.
0
 

Author Closing Comment

by:zolf
ID: 41875844
cheers!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Fix a css menu for width 15 40
Flex container in CSS 8 46
bootstrap css color change 10 49
Slow Down an Animation 3 29
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question