Ember.Location Namespace packages/ember-routing/lib/location/api.js:24


Ember.Location returns an instance of the correct implementation of the location API.

You can pass it a implementation ('hash', 'history', 'none') to force a particular implementation.

Show:

Methods

Show:

create

(options) Object

Create an instance of a an implementation of the location API. Requires an options object with an implementation property.

Example

1
2
3
var hashLocation = Ember.Location.create({implementation: 'hash'});
var historyLocation = Ember.Location.create({implementation: 'history'});
var noneLocation = Ember.Location.create({implementation: 'none'});

Parameters:

options Object

Returns:

Object
an instance of an implementation of the `location` API

registerImplementation

(name, implementation)

Registers a class that implements the location API with an implementation name. This implementation name can then be specified by the location property on the application's router class.

Example

1
2
3
4
5
Ember.Location.registerImplementation('history', Ember.HistoryLocation);

App.Router.reopen({
  location: 'history'
});

Parameters:

name String
implementation Object
of the `location` API