A static class that routes URLs within the application.

Hierarchy

  • Router

Implements

Constructors

Properties

Accessors

Methods

Constructors

  • Create a URL router.

    Parameters

    Returns Router

Properties

_routed: any
_rules: any
base: string

The base URL for the router.

commands: CommandRegistry

The command registry used by the router.

stop: Token<void>

If a matching rule's command resolves with the stop token during routing, no further matches will execute.

Accessors

  • get current(): ILocation
  • Returns the parsed current URL of the application.

    Returns ILocation

  • get routed(): ISignal<this, ILocation>
  • A signal emitted when the router routes a route.

    Returns ISignal<this, ILocation>

Methods

  • Navigate to a new path within the application.

    Parameters

    • path: string

      The new path or empty string if redirecting to root.

    • Optional options: INavOptions

      The navigation options.

    Returns void

  • Register to route a path pattern to a command.

    Parameters

    Returns IDisposable

    A disposable that removes the registered rule from the router.

  • Cause a hard reload of the document.

    Returns void

  • Route a specific path to an action.

    Notes

    If a pattern is matched, its command will be invoked with arguments that match the IRouter.ILocation interface.

    Returns Promise<void>

Generated using TypeDoc