Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IRouter

A static class that routes URLs within the application.

Hierarchy

  • IRouter

Index

Properties

Readonly base

base: string

The base URL for the router.

Readonly commands

commands: CommandRegistry

The command registry used by the router.

Readonly current

current: ILocation

The parsed current URL of the application.

Readonly routed

routed: ISignal<IRouter, ILocation>

A signal emitted when the router routes a route.

Readonly stop

stop: Token<void>

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

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 a rule that maps 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(url: string): void
  • Route a specific path to an action.

    Parameters

    • url: string

      The URL string that will be routed.

      Notes

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

    Returns void

Generated using TypeDoc