Instructs the Disposable to clean up any resources
Gets the hash part of the current url
Gets the hash part of the current url
If the current URL is /some/path?query=value#anchor
, this returns anchor
the hash (anchor) portion of the url
Registers a url change handler
Registers a url change handler
let deregisterFn = locationServices.onChange((evt) => console.log("url change", evt));
a function that will be called when the url is changing
a function that de-registers the callback
Gets the path part of the current url
Gets the path part of the current url
If the current URL is /some/path?query=value#anchor
, this returns /some/path
the path portion of the url
Gets the search part of the current url as an object
Gets the search part of the current url as an object
If the current URL is /some/path?query=value#anchor
, this returns { query: 'value' }
the search (querystring) portion of the url, as an object
Gets the current url string
Updates the url, or gets the current url
Gets the current url string
The URL is normalized using the internal path/search/hash values.
For example, the URL may be stored in the hash ([[HashLocationServices]]) or have a base HREF prepended ([[PushStateLocationServices]]).
The raw URL in the browser might be:
http://mysite.com/somepath/index.html#/internal/path/123?param1=foo#anchor
or
http://mysite.com/basepath/internal/path/123?param1=foo#anchor
then this method returns:
/internal/path/123?param1=foo#anchor
locationServices.url(); // "/some/path?query=value#anchor"
the current value of the url, as a string.
Updates the url, or gets the current url
Updates the url, changing it to the value in newurl
locationServices.url("/some/path?query=value#anchor", true);
This url should reflect only the new internal <a href="common.locationservices.html#path">path</a>, <a href="common.locationservices.html#search">search</a>, and <a href="common.locationservices.html#hash">hash</a> values.
It should not include the protocol, site, port, or base path of an absolute HREF.
The new value for the URL.
When true, replaces the current history entry (instead of appending it) with this new url
The history's state object, i.e., pushState (if the LocationServices implementation supports it)
the url (after potentially being processed)
Generated using TypeDoc
Instructs the Disposable to clean up any resources