RouterLink

Add links to routes using the RouterLink directive.
For example the following code defines a link to the route at path path-one.

<a routerLink="/path-one">Path One</a>

Navigating Programmatically

Alternatively, you can navigate to a route by calling the navigate function on the router:

this.router.navigate(['/path-one']);