Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

$locationShimProvider

The factory function used to create an instance of the $locationShim in Angular, and provides an API-compatible $locationProvider for AngularJS.

      
      class $locationShimProvider {
  constructor(ngUpgrade: UpgradeModule, location: Location, platformLocation: PlatformLocation, urlCodec: UrlCodec, locationStrategy: LocationStrategy)
$get()
hashPrefix(prefix?: string)
html5Mode(mode?: any) }

Constructor

      
      constructor(ngUpgrade: UpgradeModule, location: Location, platformLocation: PlatformLocation, urlCodec: UrlCodec, locationStrategy: LocationStrategy)
    
Parameters
ngUpgrade UpgradeModule
location Location
platformLocation PlatformLocation
urlCodec UrlCodec
locationStrategy LocationStrategy

Methods

Factory method that returns an instance of the $locationShim

      
      $get()
    
Parameters

There are no parameters.

Stub method used to keep API compatible with AngularJS. This setting is configured through the LocationUpgradeModule's config method in your Angular app.

      
      hashPrefix(prefix?: string)
    
Parameters
prefix string

Optional. Default is undefined.

Stub method used to keep API compatible with AngularJS. This setting is configured through the LocationUpgradeModule's config method in your Angular app.

      
      html5Mode(mode?: any)
    
Parameters
mode any

Optional. Default is undefined.