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

Declaring relations

Records in our application may be related; thus, Ember-data supports defining some of the following common relations:

  • One-one
  • One-many
  • Many-many

One to one

In this type of relation, only one model can belong to the other. For example, we can define two objects, a person and a passport, where the person only owns one passport:

App.Person = DS.Model.extend({

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