Interface LocationService


@JsType(isNative=true, name="ng.LocationService", namespace="<global>") public interface LocationService
Public AngularTS LocationService contract exposed through the global ng namespace for Closure-annotated applications.
  • Method Details

    • getAbsUrl

      @JsProperty String getAbsUrl()
      Public LocationService.absUrl member exposed by the AngularTS namespace contract.
    • getAppBase

      @JsProperty String getAppBase()
      Public LocationService.appBase member exposed by the AngularTS namespace contract.
    • getAppBaseNoFile

      @JsProperty String getAppBaseNoFile()
      Public LocationService.appBaseNoFile member exposed by the AngularTS namespace contract.
    • getBasePrefix

      @JsProperty String getBasePrefix()
      Public LocationService.basePrefix member exposed by the AngularTS namespace contract.
    • getHash

      String getHash()
      Return the current hash fragment.
      Returns:
      Method result.
    • getHashPrefix

      @JsProperty String getHashPrefix()
      Public LocationService.hashPrefix member exposed by the AngularTS namespace contract.
    • getPath

      String getPath()
      Returns the path of the current URL.
      Returns:
      Method result.
    • getSearch

      jsinterop.base.JsPropertyMap<Object> getSearch()
      Returns the search part of the current URL as an object.
      Returns:
      Method result.
    • getState

      Object getState()
      Returns the current history state object.
      Returns:
      Method result.
    • getUrl

      String getUrl()
      Return the current URL (for example, `/path?a=b#hash`).
      Returns:
      Method result.
    • isHtml5

      @JsProperty boolean isHtml5()
      Public LocationService.html5 member exposed by the AngularTS namespace contract.
    • parse

      void parse(String url)
      Parse given HTML5 (regular) URL string into properties
      Parameters:
      url - HTML5 URL
    • parseLinkUrl

      boolean parseLinkUrl(String url, String relHref)
      Attempts to parse a clicked link into an app-relative URL update.
      Parameters:
      url - Value supplied for the url parameter.
      relHref - Value supplied for the relHref parameter.
      Returns:
      Method result.
    • setAbsUrl

      @JsProperty void setAbsUrl(String absUrl)
      Public LocationService.absUrl member exposed by the AngularTS namespace contract.
    • setAppBase

      @JsProperty void setAppBase(String appBase)
      Public LocationService.appBase member exposed by the AngularTS namespace contract.
    • setAppBaseNoFile

      @JsProperty void setAppBaseNoFile(String appBaseNoFile)
      Public LocationService.appBaseNoFile member exposed by the AngularTS namespace contract.
    • setBasePrefix

      @JsProperty void setBasePrefix(String basePrefix)
      Public LocationService.basePrefix member exposed by the AngularTS namespace contract.
    • setHash

      Set the hash fragment and return `$location`.
      Parameters:
      hash - New hash fragment.
      Returns:
      Method result.
    • setHash

      @JsOverlay default LocationService setHash(String hash)
      Set the hash fragment and return `$location`.
      Parameters:
      hash - New hash fragment.
      Returns:
      Method result.
    • setHash

      @JsOverlay default LocationService setHash(double hash)
      Set the hash fragment and return `$location`.
      Parameters:
      hash - New hash fragment.
      Returns:
      Method result.
    • setHashPrefix

      @JsProperty void setHashPrefix(String hashPrefix)
      Public LocationService.hashPrefix member exposed by the AngularTS namespace contract.
    • setHtml5

      @JsProperty void setHtml5(boolean html5)
      Public LocationService.html5 member exposed by the AngularTS namespace contract.
    • setPath

      Changes the path parameter and returns `$location`.
      Parameters:
      path - New path.
      Returns:
      Method result.
    • setPath

      @JsOverlay default LocationService setPath(String path)
      Changes the path parameter and returns `$location`.
      Parameters:
      path - New path.
      Returns:
      Method result.
    • setPath

      @JsOverlay default LocationService setPath(double path)
      Changes the path parameter and returns `$location`.
      Parameters:
      path - New path.
      Returns:
      Method result.
    • setSearch

      LocationService setSearch(Object search)
      Sets the search part of the current URL as an object.
      Parameters:
      search - New search params as a string or object.
      Returns:
      Method result.
    • setSearchParam

      Set or remove one search parameter.
      Parameters:
      name - Value supplied for the name parameter.
      value - Value supplied for the value parameter.
      Returns:
      Method result.
    • setSearchParam

      @JsOverlay default LocationService setSearchParam(String name, Object value)
      Set or remove one search parameter.
      Parameters:
      name - Value supplied for the name parameter.
      value - Value supplied for the value parameter.
      Returns:
      Method result.
    • setSearchParam

      @JsOverlay default LocationService setSearchParam(double name, Object value)
      Set or remove one search parameter.
      Parameters:
      name - Value supplied for the name parameter.
      value - Value supplied for the value parameter.
      Returns:
      Method result.
    • setState

      LocationService setState(Object state)
      Set the history state object 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 - Value supplied for the state parameter.
      Returns:
      Method result.
    • setUrl

      LocationService setUrl(String url)
      Set the path, search, and hash, then return `$location`.
      Parameters:
      url - New URL without base prefix (e.g. `/path?a=b#hash`).
      Returns:
      Method result.