Package org.angular.ts.ng
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionPublic LocationService.absUrl member exposed by the AngularTS namespace contract.Public LocationService.appBase member exposed by the AngularTS namespace contract.Public LocationService.appBaseNoFile member exposed by the AngularTS namespace contract.Public LocationService.basePrefix member exposed by the AngularTS namespace contract.getHash()Return the current hash fragment.Public LocationService.hashPrefix member exposed by the AngularTS namespace contract.getPath()Returns the path of the current URL.jsinterop.base.JsPropertyMap<Object> Returns the search part of the current URL as an object.getState()Returns the current history state object.getUrl()Return the current URL (for example, `/path?booleanisHtml5()Public LocationService.html5 member exposed by the AngularTS namespace contract.voidParse given HTML5 (regular) URL string into propertiesbooleanparseLinkUrl(String url, String relHref) Attempts to parse a clicked link into an app-relative URL update.voidPublic LocationService.absUrl member exposed by the AngularTS namespace contract.voidsetAppBase(String appBase) Public LocationService.appBase member exposed by the AngularTS namespace contract.voidsetAppBaseNoFile(String appBaseNoFile) Public LocationService.appBaseNoFile member exposed by the AngularTS namespace contract.voidsetBasePrefix(String basePrefix) Public LocationService.basePrefix member exposed by the AngularTS namespace contract.default LocationServicesetHash(double hash) Set the hash fragment and return `$location`.default LocationServiceSet the hash fragment and return `$location`.Set the hash fragment and return `$location`.voidsetHashPrefix(String hashPrefix) Public LocationService.hashPrefix member exposed by the AngularTS namespace contract.voidsetHtml5(boolean html5) Public LocationService.html5 member exposed by the AngularTS namespace contract.default LocationServicesetPath(double path) Changes the path parameter and returns `$location`.default LocationServiceChanges the path parameter and returns `$location`.Changes the path parameter and returns `$location`.Sets the search part of the current URL as an object.default LocationServicesetSearchParam(double name, Object value) Set or remove one search parameter.default LocationServicesetSearchParam(String name, Object value) Set or remove one search parameter.Set or remove one search parameter.Set the history state object and return `$location`.Set the path, search, and hash, then return `$location`.
-
Method Details
-
getAbsUrl
Public LocationService.absUrl member exposed by the AngularTS namespace contract. -
getAppBase
Public LocationService.appBase member exposed by the AngularTS namespace contract. -
getAppBaseNoFile
Public LocationService.appBaseNoFile member exposed by the AngularTS namespace contract. -
getBasePrefix
Public LocationService.basePrefix member exposed by the AngularTS namespace contract. -
getHash
String getHash()Return the current hash fragment.- Returns:
- Method result.
-
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
Parse given HTML5 (regular) URL string into properties- Parameters:
url- HTML5 URL
-
parseLinkUrl
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
Public LocationService.absUrl member exposed by the AngularTS namespace contract. -
setAppBase
Public LocationService.appBase member exposed by the AngularTS namespace contract. -
setAppBaseNoFile
Public LocationService.appBaseNoFile member exposed by the AngularTS namespace contract. -
setBasePrefix
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
Set the hash fragment and return `$location`.- Parameters:
hash- New hash fragment.- Returns:
- Method result.
-
setHash
Set the hash fragment and return `$location`.- Parameters:
hash- New hash fragment.- Returns:
- Method result.
-
setHashPrefix
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
Changes the path parameter and returns `$location`.- Parameters:
path- New path.- Returns:
- Method result.
-
setPath
Changes the path parameter and returns `$location`.- Parameters:
path- New path.- Returns:
- Method result.
-
setSearch
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
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
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
Set the history state object and return `$location`. The state object is later passed to `pushState` or `replaceState`. Seehttps://developer.mozilla.org/en-US/docs/Web/API/History/pushState#state History.stateNOTE: 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
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.
-