Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 450 Bytes

routerlink.md

File metadata and controls

19 lines (12 loc) · 450 Bytes

Defining Links Between Routes

RouterLink

Add links to routes using the RouterLink directive.

For example the following code defines a link to the route at path component-one.

<a [routerLink]="['/component-one']">Component One</a>

Navigating Programmatically

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

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