Options
All
  • Public
  • Public/Protected
  • All
Menu

A static class that routes URLs within the application.

Hierarchy

  • Router

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Create a URL router.

    Parameters

    Returns Router

Properties

Private _routed

_routed: any

Private _rules

_rules: any

Readonly base

base: string

The base URL for the router.

Readonly commands

commands: CommandRegistry

The command registry used by the router.

Readonly stop

stop: Token<void>

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

Accessors

current

  • Returns the parsed current URL of the application.

    Returns ILocation

routed

  • A signal emitted when the router routes a route.

    Returns ISignal<this, ILocation>

Methods

navigate

  • 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

  • Register to route a path pattern to a command.

    Parameters

    Returns IDisposable

    A disposable that removes the registered rule from the router.

reload

  • reload(): void
  • Cause a hard reload of the document.

    Returns void

route

  • route(): Promise<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