O'Reilly logo

Bootstrap 4 Site Blueprints by Ian Whitley, David Cochran, Bass Jobsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Bootstrap's HTML markup code to your app

Open the app/app.component.ts file in your editor again. Replace the template metadata with a templateUrl property that points to a new app/app.component.html template file as follows:

@Component({ 
    selector: 'my-app', 
     templateUrl: 'app/app.component.html', 
     directives: [ ROUTER_DIRECTIVES ] 
    }) 

Now we can add Bootstrap HTML markup to the app/app.component.html template file. We replace the navigation list with a responsive navbar, and we add some containers and other grid classes. We should end up with HTML code like the following:

 <div class="container"> <div class="row"> <h1>{{title}}</h1> </div> </div> <nav class="navbar navbar-light bg-faded"> <button class="navbar-toggler hidden-sm-up" type="button" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required