# Class LocationProvider

##### Index

### Constructors

constructor

### Properties

$get
cachedState
hashPrefixConf
html5ModeConf
lastBrowserUrl
lastCachedState
lastHistoryState
urlChangeInit
urlChangeListeners

### Methods

getBrowserUrl
setUrl
state

## Constructors

### constructor

- new LocationProvider(): LocationProvider

  #### Returns LocationProvider

## Properties

### $get

$get: (string | (($rootScope: Scope, $rootElement: Element) => Location))[] = ...

#### Type declaration

- string
- ($rootScope: Scope, $rootElement: Element) => Location
  - - ($rootScope: Scope, $rootElement: Element): Location

    - #### Parameters

      - $rootScope: Scope
      - $rootElement: Element

      #### Returns Location

### cachedState

cachedState: any

### hashPrefixConf

hashPrefixConf: string

### html5ModeConf

html5ModeConf: Html5Mode

### lastBrowserUrl

lastBrowserUrl: string

### lastCachedState

lastCachedState: any

### lastHistoryState

lastHistoryState: any

### urlChangeInit

urlChangeInit: boolean

### urlChangeListeners

urlChangeListeners: UrlChangeListener[]

## Methods

### getBrowserUrl

- getBrowserUrl(): string

  Returns the current URL with any empty hash (`#`) removed.

  #### Returns string

### setUrl

- setUrl(url: string, state?: any): LocationProvider

  Updates the browser's current URL and history state.

  #### Parameters

  - url: string

    The target URL to navigate to.

  - `Optional` state: any

    Optional history state object to associate with the new URL.

  #### Returns LocationProvider

### state

- state(): any

  Returns the cached state.

  #### Returns any

  The cached state.