Rangle.io : Angular Training
Search…
⌃K
Introduction
License
Why Angular?
The Architect's Guide to Angular
EcmaScript 6 and TypeScript Features
The JavaScript Toolchain
Bootstrapping an Angular Application
Components in Angular
Directives
Advanced Components
Observables
Angular Dependency Injection
Http
Change Detection
Zone.js
Advanced Angular
What is Immutability
Pipes
Forms
Modules
Routing
Why Routing?
Configuring Routes
Redirecting the Router to Another Route
Defining Links Between Routes
Dynamically Adding Route Components
Using Route Parameters
Defining Child Routes
Controlling Access to or from a Route
Passing Optional Parameters to a Route
Using Auxiliary Routes
State Management
TDD Testing
Migrating AngularJS Projects to Angular
Project Setup
Angular CLI
Accessibility in Angular
Internationalization in Angular
Glossary
Further Reading And Reference
Powered By GitBook

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']);
Previous
Redirecting the Router to Another Route
Next
Dynamically Adding Route Components
Last modified 3yr ago
Copy link
On this page
RouterLink
Navigating Programmatically