O'Reilly logo

Mastering Ember.js by Mitchel Kelonye

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

Initializing the application

An Ember.js application is created by instantiating the Ember.Application class:

App = Ember.Application.create();

A few things happen when an application is first created.

A new namespace is created for the app on which we define views, controllers, and routes. This prevents us from polluting the global scope. Therefore, defining a route, for example, should be attached to it as:

App.IndexRoute = Ember.Route.extend({
  model: function() {
    return ['red', 'yellow', 'blue'];
  }
});

Ember.js usually initializes the application by calling its initialize method. This initialization can be delayed by calling the application's deferReadiness method and then recommenced with advanceReadiness. For example, imagine our application needed ...

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