Let’s start by understanding the different parts of a URL, and how they are represented internally by the router.

Consider the following simple URL:

In the introductory article for this series, we glanced over the architecture of Angular’s router, and defined three pillars of the router: router states, navigation, and lazy loading. This article will delve into the first pillar, and discuss how the router matches a URL to a set of {path:‘’,…} objects in the router configuration, which define the router states of the application. The goal for this article is to gain an in-depth understanding of what happens from the moment the router gets a new URL, until it is successfully matched against a route path. We’ll learn about the following topics, in depth:

  1. URL structure
  2. URL redirects
  3. Matching URLs to route configuration objects
  4. Router state, activated routes, and state snapshots

#angular #angular-router #url

The Three Pillars of the Angular Router — Router States and URL Matching
2.75 GEEK