graph LR
Router["Router"]
NavigationTransitions["NavigationTransitions"]
StateManager["StateManager"]
UrlTree["UrlTree"]
ActivatedRoute["ActivatedRoute"]
RouterOutlet["RouterOutlet"]
Location["Location"]
RouterConfigLoader["RouterConfigLoader"]
Router -- "delegates to" --> NavigationTransitions
Router -- "manages state via" --> StateManager
Router -- "uses" --> UrlTree
Router -- "renders into" --> RouterOutlet
Router -- "interacts with" --> Location
NavigationTransitions -- "uses" --> RouterConfigLoader
NavigationTransitions -- "creates" --> ActivatedRoute
StateManager -- "updates" --> Router
StateManager -- "interacts with" --> Location
UrlTree -- "informs" --> Router
RouterOutlet -- "binds" --> ActivatedRoute
Location -- "notifies" --> Router
click Router href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/angular/Router.md" "Details"
click NavigationTransitions href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/angular/NavigationTransitions.md" "Details"
click UrlTree href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/angular/UrlTree.md" "Details"
click RouterOutlet href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/angular/RouterOutlet.md" "Details"
The Angular Router subsystem is a sophisticated mechanism for managing application navigation. At its core, the Router orchestrates the entire routing process, acting as the central programmatic interface for navigation. It delegates the complex steps of a navigation request, including route recognition and component activation, to NavigationTransitions. The StateManager is crucial for maintaining the router's internal state and processing events, interacting closely with the Location service, which abstracts browser URL and history interactions. UrlTree provides a structured representation of the URL, enabling programmatic manipulation and informing the Router. For rendering, the Router utilizes RouterOutlet directives as placeholders in templates, which in turn bind to ActivatedRoute instances to provide components with route-specific information. Finally, RouterConfigLoader supports asynchronous loading and validation of route configurations, particularly for lazy-loaded modules, ensuring efficient and dynamic routing.
Router [Expand]
The primary orchestrator of the routing process. It initiates and manages the entire navigation lifecycle, serving as the main programmatic interface for navigation. It listens for URL changes, matches routes, and orchestrates the activation of components.
Related Classes/Methods:
NavigationTransitions [Expand]
Executes the complex steps of a navigation request. This includes route recognition, guard execution, data resolution, and component activation.
Related Classes/Methods:
Manages the router's internal state (current URL tree, activated routes) and processes router events. It also interacts with the browser's history.
Related Classes/Methods:
UrlTree [Expand]
Represents and manipulates the parsed URL structure, enabling programmatic navigation and URL manipulation.
Related Classes/Methods:
Provides a snapshot of the current route's information (parameters, data, URL segments) to components.
Related Classes/Methods:
RouterOutlet [Expand]
A directive that acts as a placeholder in the template where the Router renders components for activated routes.
Related Classes/Methods:
Provides an abstraction over the browser's URL and history API, allowing the router to interact with the browser without direct DOM manipulation.
Related Classes/Methods:
Asynchronously loads and validates route configurations, especially for lazy-loaded modules/components.
Related Classes/Methods: