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) Stringprivate

Defined in packages/ember-routing/lib/location/history_location.js:207

Used when using {{action}} helper. The url is always appended to the rootURL.

Parameters:

url String

Returns:

String
formatted url

getHashprivate

Defined in packages/ember-routing/lib/location/history_location.js:242

getStateObjectprivate

Defined in packages/ember-routing/lib/location/history_location.js:131

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

getURLStringprivate

Defined in packages/ember-routing/lib/location/history_location.js:69

Returns the current location.pathname without rootURL or baseURL

Returns:

String
url

initStateprivate

Defined in packages/ember-routing/lib/location/history_location.js:43

Used to set state on first call to setURL

onUpdateURL (callback) private

Defined in packages/ember-routing/lib/location/history_location.js:184

Register a callback to be invoked whenever the browser history changes, including using forward and back buttons.

Parameters:

callback Function

pushState (path) private

Defined in packages/ember-routing/lib/location/history_location.js:149

Pushes a new state.

Parameters:

path String

replaceState (path) private

Defined in packages/ember-routing/lib/location/history_location.js:167

Replaces the current state.

Parameters:

path String

replaceURL (path) private

Defined in packages/ember-routing/lib/location/history_location.js:114

Uses history.replaceState to update the url without a page reload or history modification.

Parameters:

path String

setURL (path) private

Defined in packages/ember-routing/lib/location/history_location.js:98

Uses history.pushState to update the url without a page reload.

Parameters:

path String

willDestroyprivate

Inherited from Ember.CoreObject but overwritten in packages/ember-routing/lib/location/history_location.js:232

Cleans up the HistoryLocation event listener.

rootURLprivate

Defined in packages/ember-routing/lib/location/history_location.js:60

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

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部