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

Creating your first application

The application script file (js/app.js) in the starter kit contains a basic Ember.js application. If you load the index.html file in your browser, you should see the three primary colors displayed:

App = Ember.Application.create();

App.Router.map(function() {
  // put your routes here
});

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

What steps led to the result?

  • First, an Ember.js application was created which then created a router.
  • The router that is responsible for state management transitioned the application into two states, the first of which was the application state. This state resulted in the application template being rendered into the DOM, hence the Welcome ...

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