Video Course

Routing Angular v2+ Applications: Lesson 4 of 23

Router Links

Up Next

Router Links: Active

Autoplaying in 7 seconds!

Cancel

Create a Free Account to Watch

Sign Up Now

Login to your account

Now that we have our app routed, we just need to create links over to those pages.

Instead of using <a href="/about">About</a>, we'll use the Angular 2 router way of linking to different routes:

<a routerLink="/about">About</a>

The router uses the HTML5 History API so that each page we navigate to will be part of the history.

Also, unlike Angular 1, we aren't using the hashbang way of routing (ie http://localhost:3000/#/about).

By default, we will be using HTML5 push-state.

Chris Sevilleja

157 posts

Co-founder of Scotch.io. Slapping the keyboard until something good happens.