AngularTS
    Preparing search index...

    Class Location

    Index

    Constructors

    • Parameters

      • appBase: string

        application base URL

      • appBaseNoFile: string

        application base URL stripped of any filename

      • Optionalhtml5: boolean = true

        Defaults to true

      • Optionalprefix: string

        URL path prefix for html5 mode or hash prefix for hashbang mode

      Returns Location

    Properties

    _state: any = undefined
    _updateBrowser?: () => void
    _url: string = ""
    absUrl: string
    appBase: string
    appBaseNoFile: string
    basePrefix?: string
    hashPrefix?: string
    html5: boolean

    Methods

    • Returns the hash fragment when called without any parameters.

      Returns string

      The current hash fragment.

    • Returns the path of the current URL.

      Returns string

    • Returns the search part of the current URL as an object.

      Returns Record<string, any>

      The current search object.

    • Returns the current history state object.

      Returns any

    • Return URL (e.g. /path?a=b#hash) when called without any parameter.

      Returns string

      The current path/search/hash string.

    • Returns string

    • Parameters

      • hash: string | number | null

      Returns this

    • Parse given HTML5 (regular) URL string into properties

      Parameters

      • url: string

        HTML5 URL

      Returns void

    • Attempts to parse a clicked link into an app-relative URL update.

      Parameters

      • url: string
      • relHref: string | null

      Returns boolean

    • Returns string

    • Parameters

      • path: string | number | null

      Returns this

    • Returns Record<string, any>

    • Parameters

      • search: string | number | Record<string, any>

      Returns this

    • Parameters

      • search: string | number | Record<string, any>
      • OptionalparamValue: string | number | boolean | string[] | null

      Returns this

    • Changes the hash fragment when called with a parameter and returns $location.

      Parameters

      • hash: string | number | null

        New hash fragment.

      Returns Location

      The Location instance.

    • Changes the path parameter and returns $location.

      Parameters

      • path: string | number | null

        New path.

      Returns Location

    • Sets the search part of the current URL as an object.

      Parameters

      • search: string | number | Record<string, any>

        New search params as a string or object.

      • OptionalparamValue: string | number | boolean | string[] | null

        If search is a string or number, overrides only a single search property.

      Returns Location

      The Location instance.

    • Change the history state object when called with one parameter and return $location. The state object is later passed to pushState or replaceState. See https://developer.mozilla.org/en-US/docs/Web/API/History/pushState#state|History.state

      NOTE: This method is supported only in HTML5 mode and only in browsers supporting the HTML5 History API (i.e. methods pushState and replaceState). If you need to support older browsers (like IE9 or Android < 4.0), don't use this method.

      Parameters

      • state: any

      Returns Location

      The Location instance.

    • Change path, search and hash, when called with parameter and return $location.

      Parameters

      • url: string

        New URL without base prefix (e.g. /path?a=b#hash).

      Returns Location

      The Location instance.

    • Returns any

    • Parameters

      • state: any

      Returns this

    • Returns string

    • Parameters

      • url: string

      Returns this