NoneLocation

Ember.NoneLocation Class

PRIVATE

Extends: Ember.Object

Defined in: packages/ember-routing/lib/location/none_location.js:13

Module: ember-routing

Ember.NoneLocation does not interact with the browser. It is useful for testing, or when you need to manage state with your Router, but temporarily don't want it to muck with the URL (for example when you embed your application in a larger page).

formatURL (url) Stringprivate

Defined in packages/ember-routing/lib/location/none_location.js:99

Given a URL, formats it to be placed into the page as part of an element's href attribute.

This is used, for example, when using the {{action}} helper to generate a URL based on an event.

Parameters:

url String

Returns:

String
url

getURLStringprivate

Defined in packages/ember-routing/lib/location/none_location.js:44

Returns the current path without rootURL.

Returns:

String
path

handleURL (callback) private

Defined in packages/ember-routing/lib/location/none_location.js:87

Sets the path and calls the updateURL callback.

Parameters:

callback Function

onUpdateURL (callback) private

Defined in packages/ember-routing/lib/location/none_location.js:74

Register a callback to be invoked when the path changes. These callbacks will execute when the user presses the back or forward button, but not after setURL is invoked.

Parameters:

callback Function

setURL (path) private

Defined in packages/ember-routing/lib/location/none_location.js:62

Set the path and remembers what was set. Using this method to change the path will not invoke the updateURL callback.

Parameters:

path String

rootURLprivate

Defined in packages/ember-routing/lib/location/none_location.js:35

Will be pre-pended to path.

Default: '/'

© 2017 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://emberjs.com/api/classes/Ember.NoneLocation.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部