DaffRouterActivatedRoute

Allows accessing the currently activated route from anywhere in the DI hierarchy. Contrasted to simply injecting ActivatedRoute, this will be accurate even from outside the router outlet.

Note that this service operates by listening to router events. It is therefore recommended to inject this service in the root and subscribe to route$ on app init so that all routing events are captured. The consumer can then subscribe at any later time (after all navigations) and the emission stream will be replayed.

Properties

Name Type Description
route$ Observable<ActivatedRoute>
Graycore, LLC © 2018 - 2024. Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.