Skip to content

Routing Introduction

Routing is the process of determining what content to display based on the browser’s URL. Angular is a Single Page Application (SPA) framework, handling URL changes within the application with JavaScript, not reloading the whole page on each new navigation, thanks to its router API.

The project currently only displays the TaskList component in your browser. The Router will enable switching between this component and the new TaskFormComponent.

The Router API is provided by the @angular/forms package. It’s installed in any new Angular project by default and you can find it in the package.json file.

We need three parts to implement routing:

  • a list of routes to define the content displayed for a given URL
  • a marker to decide where to display the content
  • a link to trigger the navigation