O'Reilly logo

Instant Ember.js Application Development How-to by Marc Bodmer

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 an Ember model/object (Simple)

An object or a model is a way to manage data in a structured way. In other words, they are a way of representing persistent states in your application. In Ember.js, almost every object is derived from the Ember.Object class. Since most objects will be derived from the same base object, they will end up sharing properties with each other. This allows the observation and binding to properties of other objects. That being said, we can see where some of the powerful features of Ember, such as computed properties and bindings, come from.

How to do it...

We will create a basic model object and then create a subclass of this object.

  1. In your models folder, go ahead and create the following file called movie.js.
    MovieTracker.Movie ...

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