Bootstrap in Angular application
Description : In this article we will learn how to install Bootstrap in Angular application Bootstrap is used to create responsive web applications.
Prerequisites
knowledge of HTML is required.
Basic knowledge of TypeScript
Node and NPM installed
Angular Cli
step1 Create new angular project using command prompt
ng new BootstrapDemo
step 2 Open Project cd BootstrapDemo
step 3 npm install bootstrap --save
step 4 open Style.css
step 5 To add reference in styles.css file add this line,
@import '~bootstrap/dist/css/bootstrap.min.css';
step 6 : Let's create a form using Bootstrap Add these lines in app.component.html of html and bootstrap to design form.
<router-outlet></router-outlet>
<div class="container">
<form class="form-inline">
<div class="form-group">
<label class="sr-only" for="email">Email:</label>
<input type="email" class="form-control" id="email" placeholder="Enter email" name="email">
</div>
<div class="form-group">
<label class="sr-only" for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd" placeholder="Enter password" name="pwd">
</div>
<button type="button" class="btn btn-success">Submit</button>
</form>
</div>
step 7 : Run the project using ng serve commnad and check the result
Summery :- In this Article we Learned How to Install Boostrap into Angular Application .
Comments
Post a Comment