• JMap.History.onParameterChange

    You can attach a listener that listen for url hash params change.

    The function returns the listener id that can be used after to remove the listener.

    Parameters

    • parameterName: string

      the name of the parameter

    • fn: ((oldValue, newValue) => void)

      the function that will be processed when the property changed

        • (oldValue, newValue): void
        • Parameters

          • oldValue: string
          • newValue: undefined | string

          Returns void

    Returns string

    the listener id, can be used to remove the listener with JMap.History.removePropertyChangeListener

    Throws

    Error if parameterName is not a valid string or fn is not a function

    Example

    const listenerId = JMap.History.onParameterChange("ngProjectId", (oldValue, newValue) => {
    console.log(`In the url hash the parameter "ngProjectId" has changed from "${oldValue}" to "${newValue}"`)
    })