Interface IRouter

A static class that routes URLs within the application.


  • IRouter


base: string

The base URL for the router.

commands: CommandRegistry

The command registry used by the router.

current: ILocation

The parsed current URL of the application.

A signal emitted when the router routes a route.

stop: Token<void>

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


  • Navigate to a new path within the application.


    • path: string

      The new path or empty string if redirecting to root.

    • Optional options: INavOptions

      The navigation options.

    Returns void

  • Register a rule that maps a path pattern to a command.


    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.


    • url: string

      The URL string that will be routed.


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

    Returns void

Generated using TypeDoc