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

Chapter 2. Understanding Ember.js Objects and Mixins

Having learned how to create a basic Ember.js application in the previous chapter, this chapter will introduce us to Ember.js objects, which are the foundation of the rest of the base classes. Therefore, most of the concepts discussed will be applied throughout the book. By the end of this chapter, we'll be able to:

  • Create Ember.js objects
  • Define, get, and set object properties
  • Define computed properties
  • Register property change observers
  • Use mixins

Creating objects in Ember.js

We all know how to define and create instances of function objects in JavaScript, as shown in the following code:

function Point(x, y, z){ this.x = x; this.y = y; this.z = z; } Point.prototype.logX = function(){ console.log(this.x); ...

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