Router configuration

Angular uses tree data structures to represent the router state. You can imagine that every navigation in your application activates a branch in this tree. Let's look at the following example.

We have an application that consists of four possible routes:

  • /: This is the root route of the application, which is handled in a component called A.
  • /b/:id: This is the route where we can access the b detail view, which is handled in a component called B. In the URL, we can pass an id parameter (that is, /b/100).
  • /b/:id/c: This is the route where the b detail view has another navigation possibility, which reveals more specific details that we call c. This is handled in a C component.
  • /b/:id/d: This is the route where we can also ...

Get Mastering Angular Components now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.