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

Bindings across objects

Till now, we have seen bindings and dependencies between the properties of one object. Ember.js provides you with the ability to take those dependencies across objects. There could be cases wherein the properties of one object depend on the properties of another object. In such a case, Ember.js bindings come really handy.

Let us see that in the following example, chapter-2/example9/:

import Ember from 'ember';

export default Ember.Object.extend({
  name: "",
  age:18,
  address:"",
});

The contents of father.js are present in chapter-2/example9/app/father.js

import Ember from 'ember';

export default Ember.Object.extend({
  school:'',
  father:null,
  address: Ember.computed.alias('father.address')
});

The contents of child.js are present ...

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