O'Reilly logo

Ember.js Web Development with Ember CLI by Suchit Puri

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The location API

At the start of this chapter, when we were discussing about the router.js, or the application router that manages different URL states of the application, we passed in the location property to our Router object. The property was being read from config/environment.js file:

var Router = Ember.Router.extend({
  location: config.locationType
});

The Router definition is present at example1/app/router.js

If you look into the config/environment.js file, you will see that the location property is set to auto for development and production environments and for test environments it is set to none.

The location API governs how to generate URLs for your application. The location property can be assigned one of these four values: hash, history ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required