In this section, we enable routing and create the main navigation bar for our application. The steps to enable routes are as follows:
- Adding the base reference URL: We will need to add a base element in index.html to tell the Angular router how to compose the navigation URL.
We added href in the head tag of index.html:
- Creating the main navigation bar: Most web applications have a navigation bar at the top of the page for navigating to different pages in the application. We have added a main navigation bar for our friends application using the bootstrap nav bar component.
- The first step is to include the nav tag in app.component.html, as follows:
<nav class="navbar navbar-expand-lg ...