Gets the base Href, e.g., http://localhost/approot/
Gets the base Href, e.g., http://localhost/approot/
the application's base href
Defines whether URL matching should be case sensitive (the default behavior), or not.
Defines whether URL matching should be case sensitive (the default behavior), or not.
// Allow case insensitive url matches
urlService.config.caseInsensitive(true);
false
to match URL in a case sensitive manner; otherwise true
;
the current value of caseInsensitive
Sets the default behavior when generating or matching URLs with default parameter values.
Sets the default behavior when generating or matching URLs with default parameter values.
// Remove default parameter values from the url
urlService.config.defaultSquashPolicy(true);
A string that defines the default parameter URL squashing behavior.
nosquash
: When generating an href with a default parameter value, do not squash the parameter value from the URLslash
: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the
parameter is surrounded by slashes, squash (remove) one slash from the URLthe current value of defaultSquashPolicy
Instructs the Disposable to clean up any resources
Instructs the Disposable to clean up any resources
Gets the hashPrefix (when not running in pushstate mode)
Sets the hashPrefix (when not running in pushstate mode)
Gets the hashPrefix (when not running in pushstate mode)
If the current url is http://localhost/app#!/uirouter/path/#anchor
, it returns !
which is the prefix for the "hashbang" portion.
the hash prefix
Sets the hashPrefix (when not running in pushstate mode)
the new hash prefix
Gets the host, e.g., localhost
Gets the host, e.g., localhost
the protocol
Returns true when running in pushstate mode
Returns true when running in pushstate mode
true when running in pushstate mode
Gets the port, e.g., 80
Gets the port, e.g., 80
the port number
Gets the protocol, e.g., http
Gets the protocol, e.g., http
the protocol
Defines whether URLs should match trailing slashes, or not (the default behavior).
Defines whether URLs should match trailing slashes, or not (the default behavior).
// Allow optional trailing slashes
urlService.config.strictMode(false);
false
to match trailing slashes in URLs, otherwise true
.
the current value of strictMode
Creates and registers a custom ParamTypeDefinition object
Creates and registers a custom ParamTypeDefinition object
A custom parameter type can be used to generate URLs with typed parameters or custom encoding/decoding.
// Encode object parameter as JSON string
urlService.config.type('myjson', {
encode: (obj) => JSON.stringify(obj),
decode: (str) => JSON.parse(str),
is: (val) => typeof(val) === 'object',
pattern: /[^/]+/,
equals: (a, b) => _.isEqual(a, b),
});
The type name.
The type definition. See ParamTypeDefinition for examples and information.
if only the name
parameter was specified: the currently registered ParamType object, or undefined
Generated using TypeDoc
An API to customize the URL behavior and retrieve URL configuration
This API can customize the behavior of the URL. This includes optional trailing slashes (strictMode), case sensitivity (caseInsensitive), and custom parameter encoding (custom type).
It also has information about the location (url) configuration such as port and baseHref. This information can be used to build absolute URLs, such as
https://example.com:443/basepath/state/substate?param1=a#hashvalue
;This API is found on UrlService.config.