Improve this Doc View Source $locationProvider
Overview
Use the $locationProvider to configure how the application deep linking paths are stored.
Methods
-
hashPrefix([prefix]);
The default value for the prefix is
'!'.Parameters
Param Type Details prefix (optional)stringPrefix for hash part (containing path and search)
Returns
*current value if used as getter or itself (chaining) if used as setter
-
html5Mode([mode]);
Parameters
Param Type Details mode (optional)booleanObjectIf boolean, sets
html5Mode.enabledto value. If object, setsenabled,requireBaseandrewriteLinksto respective values. Supported properties:-
enabled –
{boolean}– (default: false) If true, will rely onhistory.pushStateto change urls where supported. Will fall back to hash-prefixed paths in browsers that do not supportpushState. -
requireBase -
{boolean}- (default:true) When html5Mode is enabled, specifies whether or not atag is required to be present. If enabledandrequireBaseare true, and a base tag is not present, an error will be thrown when$locationis injected. See the $location guide for more information -
rewriteLinks -
{boolean|string}- (default:true) When html5Mode is enabled, enables/disables URL rewriting for relative links. If set to a string, URL rewriting will only happen on links with an attribute that matches the given string. For example, if set to'internal-link', then the URL will only be rewritten for<a internal-link>links. Note that attribute name normalization does not apply here, so'internalLink'will not match'internal-link'.
Returns
Objecthtml5Mode object if used as getter or itself (chaining) if used as setter
-
enabled –
© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 3.0.
https://code.angularjs.org/1.8.2/docs/api/ng/provider/$locationProvider