router-x/src/services/route-aware.service.ts
Provides functionality for extending class to easily work with routes and process changes.
Properties |
|
Methods |
|
Accessors |
constructor(router: Router, route: ActivatedRoute, componentBus?: RouterOutletComponentBus)
|
||||||||||||||||
Creates an instance of RouteAware. Provide this when you want your route-aware service to have access to the instance(s) of the activated component(s).
Parameters:
|
||||||||||||||||
Protected deepScanRoute | ||||||||||||||||||||
deepScanRoute(route: ActivatedRouteSnapshot, process: (route: ActivatedRouteSnapshot,component: any) => void, levels: number)
|
||||||||||||||||||||
Recoursively runs a processing function on the route and its children. Scan is done from parent to child, meaning the parent is the first to process. and a Returning
Parameters:
Returns:
void
|
||||||||||||||||||||
Protected observeRouterEvent | |||||||||||||||
observeRouterEvent(eventType: Type
|
|||||||||||||||
Type parameters:
|
|||||||||||||||
Creates an observable that emits only the specified router events and is automatically destroyed when the service/component is destroyed.
Parameters:
Returns:
Observable<TEvent>
|
|||||||||||||||
Protected resolve | ||||||||||||
resolve(resolvers: Resolver | Resolver[], ...resolverArgs: any[])
|
||||||||||||
Creates an observable that runs all the specified resolvers and concats their results as an array. The resolvers will be passed with the instance of the component for the currently activated route.
Parameters:
Returns:
Observable<any[]>
An array with the concatenated results of the resolvers. |
||||||||||||
Protected resolveInMacroTask | ||||||||||||
resolveInMacroTask(resolvers: Resolver | Resolver[], ...resolverArgs: any[])
|
||||||||||||
Creates an observable that runs all the specified resolvers and concats their results as an array. The resolvers will be passed with the instance of the component for the currently activated route. Angular Universal: In SSR, the server doesn't wait for async code to complete. The result is scrapers and search engines receiving a page without resolved data, which is bad in case you need them to read some resolved metadata tags for example. Using
See https://stackoverflow.com/a/50065783/4371525 for the discussion. See {ResolverMacroTaskIdPrefix} if you need to identify the created macro task in your code.
Parameters:
Returns:
Observable<any[]>
|
||||||||||||
ngOnDestroy |
ngOnDestroy()
|
Inherited from
Destroyable
|
Returns:
void
|
Protected subscribe | ||||||||||||||||||||
subscribe(observable: Observable
|
||||||||||||||||||||
Inherited from
Destroyable
|
||||||||||||||||||||
Type parameters:
|
||||||||||||||||||||
Subscribes to an observable and stores the subscription for automatic disposal.
When
Parameters:
Returns:
Subscription
The subscription created for the observable. |
||||||||||||||||||||
Protected Readonly destroyed |
Type: Subject<void>
|
Default value: new Subject()
|
Inherited from
Destroyable
|
Emits a value when |
Protected Readonly subscriptions |
Type: Subscription
|
Default value: new Subscription()
|
Inherited from
Destroyable
|
A list of all subscriptions manually added using the |