This module contains standalone util functions which automatically hook into the router and other services to give you an easy-to-use API.
These can be used in any component, service, directive or pipe.
⚠️ The
router-x
module is in PREVIEW mode. Implementation might change. Avoid using in production.Please provide feedback on the module.
useRouterEvent()
Allows you to subscribe to a specific router event:
useRouterEvents()
Allows you to subscribe to multiple specific router events:
useRouteDeepScan()
Allows you to listen to route changes and process the activated route and its children.
See PublishComponentDirective
for more details on the activated component.
You can also directly call deepScanRoute()
to perform a one-time scan manually.
useRouterOutletStateTracker()
Allows observing the current state of activated router outlets. This emits a dictionary of named outlets which holds the instances of their respective component instances.
See PublishComponentDirective
for more details.
useActivatedRouteComponent()
Allows observing the component initialized for the currently activated route.
See PublishComponentDirective
for more details.