How to do it...

  1. Open the console and cd to chapter12/start.
  2. Run ng new recipe3 to have Angular CLI start a new project called "recipe3".
  3. Go to the new project, that is, cd recipe3.
  4. Add Bootstrap 4 via NPM:
npm install bootstrap@4.0.0-alpha.6 --save
  1. Add ng-bootstrap by running the following command in your console:
npm install @ng-bootstrap/ng-bootstrap --save
  1. In the preceding recipe, we worked with the default component. Now, let's add a custom component:
ng generate component jumbotron
  1. Go to src/app/app.component.html, delete everything, and add the following code:
<app-jumbotron></app-jumbotron>
  1. In app/jumbotron/jumbotron.component.html, add the following code:
<div class="jumbotron jumbotron-fluid"> <div class="container"> ...

Get Bootstrap 4 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.