HistoryLocation
Ember.HistoryLocation Class
PRIVATE
Extends: Ember.Object
Defined in: packages/ember-routing/lib/location/history_location.js:16
Module: ember-routing
Ember.HistoryLocation implements the location API using the browser's history.pushState API.
formatURL (url) String
private
Used when using {{action}}
helper. The url is always appended to the rootURL.
Parameters:
-
url
String
Returns:
-
String
- formatted url
getHashprivate
getStateObject
private
Get the current history.state
. Checks for if a polyfill is required and if so fetches this._historyState. The state returned from getState may be null if an iframe has changed a window's history.
Returns:
-
Object
- state
getURLString
private
Returns the current location.pathname
without rootURL
or baseURL
Returns:
-
String
- url
initStateprivate
Used to set state on first call to setURL
onUpdateURL (callback) private
Register a callback to be invoked whenever the browser history changes, including using forward and back buttons.
Parameters:
-
callback
Function
pushState (path) private
Pushes a new state.
Parameters:
-
path
String
replaceState (path) private
Replaces the current state.
Parameters:
-
path
String
replaceURL (path) private
Uses history.replaceState
to update the url without a page reload or history modification.
Parameters:
-
path
String
setURL (path) private
Uses history.pushState
to update the url without a page reload.
Parameters:
-
path
String
willDestroyprivate
Cleans up the HistoryLocation event listener.
rootURLprivate
Will be pre-pended to path upon state change
Default: '/'
© 2017 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://emberjs.com/api/classes/Ember.HistoryLocation.html