Angular Router
Learn how Angular routing works and what code is required in page components to implement routing.
We'll cover the following...
How routing works
The Angular Router handles the user’s request to navigate to a page within the application through the following steps:
- Reads the requested URL
- If the requested URL is defined, a URL redirect is applied
- Determines which state applies to the destination URL
- Authentication guards, if required, are activated (we’ll cover these a little later in this chapter)
- Data that is required for the router state is fully resolved
- Triggers the necessary Angular components required to display the page for the requested URL
- Manages the navigation between pages
- Repeats steps 1 to 7 when a new page is requested
With this understanding in place, let’s look at the different modules, components, and page elements required to manage this routing and ...