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

Defining relationships between your ember-data models

When defining model objects in your application, you may realize the need to refer or link two models together, something very similar to what you do in relational databases. Ember Data lets you do that in a very easy manner by providing support for the several possible relationship types that two models can have with each other.

Currently, three types of relationships are supported in ember-data:

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

Let's see what each relationship types mean, and how to define it in your model objects.

One-to-one

The one to one type of relationship means that the model attribute is linked to one, and only one, object. In Ember Data, you can link an attribute to one other object by ...

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