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 interfaceTypeScript callback contract for this property.static interfaceTypeScript callback contract for this property.static interfaceTypeScript callback contract for this property.static interfacestatic interfacestatic interfaceTypeScript callback contract for this property.static interfaceTypeScript callback contract for this property. -
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()Returns the hash fragment when called without any parameters.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 URL (e.g.hash()Public LocationService.hash member exposed by the AngularTS namespace contract.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.path()Public LocationService.path member exposed by the AngularTS namespace contract.jsinterop.base.JsPropertyMap<Object> search()Public LocationService.search member exposed by the AngularTS namespace contract.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) Changes the hash fragment when called with a parameter and returns `$location`.default LocationServiceChanges the hash fragment when called with a parameter and returns `$location`.Changes the hash fragment when called with a parameter and returns `$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.Change the history state object when called with one parameter and return `$location`.Change path, search and hash, when called with parameter and return `$location`.state()Public LocationService.state member exposed by the AngularTS namespace contract.url()Public LocationService.url member exposed by the AngularTS namespace contract.
-
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()Returns the hash fragment when called without any parameters.- 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
LocationService.StateCallback getState()Returns the current history state object.- Returns:
- Method result.
-
getUrl
String getUrl()Return URL (e.g. `/path?a=b#hash`) when called without any parameter.- Returns:
- Method result.
-
hash
String hash()Public LocationService.hash member exposed by the AngularTS namespace contract.- 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.
-
path
String path()Public LocationService.path member exposed by the AngularTS namespace contract.- Returns:
- Method result.
-
search
jsinterop.base.JsPropertyMap<Object> search()Public LocationService.search member exposed by the AngularTS namespace contract.- 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
Changes the hash fragment when called with a parameter and returns `$location`.- Parameters:
hash- New hash fragment.- Returns:
- Method result.
-
setHash
Changes the hash fragment when called with a parameter and returns `$location`.- Parameters:
hash- New hash fragment.- Returns:
- Method result.
-
setHash
Changes the hash fragment when called with a parameter and returns `$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.paramValue- If `search` is a string or number, overrides only a single search property.- Returns:
- Method result.
-
setState
Change the history state object when called with one parameter 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
Change path, search and hash, when called with parameter and return `$location`.- Parameters:
url- New URL without base prefix (e.g. `/path?a=b#hash`).- Returns:
- Method result.
-
state
Object state()Public LocationService.state member exposed by the AngularTS namespace contract.- Returns:
- Method result.
-
url
String url()Public LocationService.url member exposed by the AngularTS namespace contract.- Returns:
- Method result.
-