Module Navigation

Index

Variables

Functions

Variables

canGoBack: boolean

Determines whether it is possible to navigate backwards.

canGoForward: boolean

Determines if it is possible to navigate forwards.

history: any

Gets or sets the navigation history.

location: string

Gets or sets the current location.

state: any

Gets or sets a user-defined object that represents the state associated with the current location.

Functions

addEventListener(eventType: string, listener: Function, capture?: boolean)

Adds an event listener to the control.

Parameters

  • eventType: string

    The type (name) of the event.

  • listener: Function

    The listener to invoke when the event gets raised.

  • capture?: boolean optional

    If true, specifies that capture should be initiated, otherwise false.

back(distance?: number): Promise

Navigates backwards.

Parameters

  • distance?: number optional

    The number of entries to go back into the history.

Returns

Promise

A promise that is completed with a value that indicates whether or not the navigation was successful.

forward(distance?: number): Promise

Navigates forwards.

Parameters

  • distance?: number optional

    The number of entries to go forward.

Returns

Promise

A promise that is completed with a value that indicates whether or not the navigation was successful.

navigate(location: any, initialState?: any): Promise

Navigates to a location.

Parameters

  • location: any

    The location to navigate to. Generally the location is a string containing the URL, but it may be anything.

  • initialState?: any optional

    A user-defined object that represents the navigation state that may be accessed through state.

Returns

Promise

A promise that is completed with a value that indicates whether or not the navigation was successful (true if successful, otherwise false).

onbeforenavigate(eventInfo: CustomEvent)

Occurs before navigation.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event. The detail property of this object contains the following sub-properties: location, state.

onnavigated(eventInfo: CustomEvent)

Occurs after navigation has taken place.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event. The detail property of this object contains the following sub-properties: location, state.

onnavigating(eventInfo: CustomEvent)

Occurs when navigation is taking place.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event. The detail property of this object contains the following sub-properties: location, state.

removeEventListener(eventType: string, listener: Function, useCapture?: boolean)

Removes an event listener from the control.

Parameters

  • eventType: string

    The type (name) of the event.

  • listener: Function

    The listener to remove.

  • useCapture?: boolean optional

    Specifies whether or not to initiate capture.