Class ActivatedRoute<TReturn, THandlerParams>

Class representing a resolved route that a request is mounted to.

Type Parameters

  • TReturn

  • THandlerParams extends unknown[]

Hierarchy

  • ActivatedRoute

Constructors

  • Type Parameters

    • TReturn

    • THandlerParams extends unknown[]

    Parameters

    • route: Route<TReturn, THandlerParams>

      The route this ActivatedRoute refers to.

    • path: string

      The request path that activated that route.

    Returns ActivatedRoute<TReturn, THandlerParams>

Properties

handler: Constructable<((...x: THandlerParams) => TReturn)>

The resolved function that should handle the request for this route.

parameters: HandlerParamProviders<THandlerParams>
params: {
    [key: string]: string;
}

The parsed params from the route definition.

Example

If the route definition is like /something/something/:paramName1/:paramName2/etc and the request came in on /something/something/foo/bar/etc, then the params would be:

{
paramName1: 'foo',
paramName2: 'bar',
}

Type declaration

  • [key: string]: string
path: string

The request path that activated that route.

postflight: ResolvedRouteHandler[]

Post-middleware that should be applied to the request on this route.

Pre-middleware that should be applied to the request on this route.

resolvedParameters?: THandlerParams
route: Route<TReturn, THandlerParams>

The route this ActivatedRoute refers to.