Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IUrlManager

A UrlManager is a simple class for interfacing with the browser URL.

The UrlManager is not intended to store state, and will not allow many->many bindings to the URL.

export
interface

IUrlManager

Hierarchy

  • IUrlManager

Implemented by

Index

Properties

Optional importedDashboard

importedDashboard: DashboardSerializer.ISerializedDashboard

The currently imported dashboard, if specified in the URL.

Optional onDashboardImport

onDashboardImport: Observable<ISerializedDashboard>

An event emitted when the URLManager has imported a dashboard model

onPathChange

onPathChange: Observable<string>

An event emitted when the path is changed by user-agent navigation.

This is typically a change that occurs due to hitting the 'back' button.

onQueryChange

onQueryChange: Observable<Readonly<URLSearchParams>>

An event emitted when the query string is changed by user-agent navigation.

path

path: string

The current URL path, relative to a base url.

On set, will navigate to the given path and add a history item to the user-agent's history stack.

Note

Setting this will not trigger an onPathChange event.

query

query: Readonly<URLSearchParams>

The current query parameters of the URL.

On set, will navigate to the same path with the given query parameters, replacing the history item in the user-agent's history stack.

Note

As with path, setting this will not trigger onQueryChange.

Methods

makeUrlFromComponents

  • makeUrlFromComponents(path: string, query: string): string
  • Create a new URL with the given path and query.

    Parameters

    • path: string

      The path component of the URL to construct

    • query: string

      The query component of the URL to construct

    Returns string

    A URL that will point to the given path/query combination

    Notes

    Occasionally, you may need to construct a URL for your own purposes outside of the URL manager (such as for a dashboard hover or opening in a new tab), but you still need assurances that the URL is valid. #makeUrlFromComponents is the best way to accomplish this without having to rewrite some URL management code yourself.

    This function will not modify any state.

Generated using TypeDoc