Solved

Adding Bootstrap 3 to Angular 2 application

Posted on 2016-11-02
4
38 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
  • 2
4 Comments
 
LVL 51

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 51

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article discusses four methods for overlaying images in a container on a web page
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…

759 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now