graph LR
NavigationTransitions["NavigationTransitions"]
Router["Router"]
UrlTree["UrlTree"]
StateManager["StateManager"]
Recognize["Recognize"]
CheckGuards["CheckGuards"]
ResolveData["ResolveData"]
ActivateRoutes["ActivateRoutes"]
Location["Location"]
Router -- "initiates navigation requests for" --> NavigationTransitions
NavigationTransitions -- "signals completion to" --> Router
NavigationTransitions -- "utilizes" --> UrlTree
NavigationTransitions -- "delegates state updates to" --> StateManager
NavigationTransitions -- "interacts with" --> Location
NavigationTransitions -- "invokes" --> Recognize
NavigationTransitions -- "calls" --> CheckGuards
NavigationTransitions -- "invokes" --> ResolveData
NavigationTransitions -- "triggers" --> ActivateRoutes
UrlTree -- "provides structured URL to" --> Recognize
Recognize -- "returns route configuration to" --> NavigationTransitions
CheckGuards -- "executes guards for" --> NavigationTransitions
ResolveData -- "fetches data for" --> NavigationTransitions
ActivateRoutes -- "manages components for" --> NavigationTransitions
click NavigationTransitions href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/angular/NavigationTransitions.md" "Details"
click Router href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/angular/Router.md" "Details"
click UrlTree href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/angular/UrlTree.md" "Details"
click Recognize href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/angular/Recognize.md" "Details"
The Angular Router subsystem orchestrates the navigation within an application, managing the lifecycle from a URL change to component rendering. It follows a "Routing Flow" pattern, where Router initiates navigation, NavigationTransitions guides the process through various stages, including URL parsing by UrlTree, route matching by Recognize, guard execution by CheckGuards, data pre-fetching by ResolveData, and finally, component activation by ActivateRoutes. StateManager maintains the router's internal state, while Location provides an abstraction for browser interaction. This structured flow ensures consistent and controlled navigation, adapting to application logic and data requirements.
NavigationTransitions [Expand]
The central orchestrator of the entire navigation lifecycle. It manages the detailed steps of a navigation request, including executing guard checks, resolving data, and loading/activating components. This aligns with the "Routing Flow" pattern, acting as the central control for the navigation pipeline.
Related Classes/Methods:
Router [Expand]
Provides the public API for initiating and managing navigation within the application. It's the primary entry point for developers to interact with the routing system. This is a standard "Routing" pattern component.
Related Classes/Methods:
UrlTree [Expand]
Represents the parsed and structured form of a URL. It handles the parsing, serialization, and comparison of URL segments, crucial for route matching and navigation. Essential for the "Routing Flow" to interpret and construct URLs.
Related Classes/Methods:
Manages the router's internal state, including the current UrlTree and historical entries, ensuring consistency with the browser's URL. This is vital for maintaining the integrity of the "Routing Flow" and enabling features like back/forward navigation.
Related Classes/Methods:
Recognize [Expand]
Matches a given UrlTree against the configured routes to determine the target ActivatedRouteSnapshot tree. This is a fundamental step in any "Routing Flow" to identify which components should be rendered.
Related Classes/Methods:
Executes route guards (e.g., CanActivate, CanDeactivate, CanLoad) to control navigation flow based on authorization, data availability, or other conditions. This implements a critical aspect of "Routing Flow" for security and conditional navigation.
Related Classes/Methods:
Handles asynchronous data fetching for routes, ensuring necessary data is available before component activation. This supports the "Data Flow" pattern within the "Routing Flow" by pre-loading data required by the activated components.
Related Classes/Methods:
Manages the activation and deactivation of components and child routes, updating the UI based on the current router state. This directly supports the "Component-Based Architecture" by rendering the correct views as part of the "Routing Flow".
Related Classes/Methods:
Provides an abstraction for NavigationTransitions to interact with the browser's URL and history, allowing the router to update the address bar and respond to browser navigation events.
Related Classes/Methods: