Questions tagged [ember-data]

ember-data is a data persistence extension for the Ember.js framework.

Because the MVC framework builds applications which run in the browser rather than returning fully-rendered pages in response to browser requests, it requires a method for saving and reloading user data.

Ember.js supports a number of "data persistence" libraries, including a data store component inherited from the framework. In general these frameworks support CRUD operations on a RESTful web service, and as such they are agnostic regarding the technology of the back-end web service.

Ember-data is the "official" data persistence library for Ember.js, supported by the Ember.js team. It uses "adapters" to load data for use by Ember.js applications, and allows developers to write custom adapters to support their own specific data store.

Beta Period

During the beta period (up until 1.0) the API is constantly changing, you can keep up to date by reading the Transition Document.

Getting help

Ember-data is supported in much the same way as Ember.js itself.

The Stack Overflow tag is actively monitored by several contributors to Ember. You may try asking questions in the active IRC channel #emberjs on irc.freenode.net. Other resources can found on the Ember.js community page

Technical questions that are accompanied by working code make it easier for other to help give good answers. JSFiddle | JSBin

To report bugs against Ember.js, or to propose new functionality, create an issue on the Github project.

5483 questions
13
votes
2 answers

List not updated after deleteRecord

I have an ArrayController whose content is defined in a route like that: App.UsersRoute = Ember.Route.extend({ model: function() { return App.User.find(); }, setupController: function(controller, model) { this._super(controller,…
Frédéric Mascaro
  • 520
  • 1
  • 4
  • 17
13
votes
3 answers

Ember-data polymorphic associations

Has anybody come up with an answer for polymorphic associations and ember-data? We would need some way of being able to query the type at the other end of the relationship from what I can tell. Anybody any thoughts on this?
dagda1
  • 26,856
  • 59
  • 237
  • 450
12
votes
5 answers

Non CRUD actions with ember-data

Say I have the following ember-data model: App.Person = DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string'), starred: DS.attr('boolean') }); This communicates with a Rails app with the following pretty…
rlivsey
  • 2,124
  • 2
  • 18
  • 21
12
votes
2 answers

Ember: Relationship link related data not loading / disappearing

I'm experiencing somewhat of a bug with Ember/Ember-data. Here's my scenario: Client lands on / route and Ember loads data from /api/v1/videos?limit=8. The response comes from a rails-api backend using active_model_serializers which ensures the…
Maros
  • 1,825
  • 4
  • 25
  • 56
12
votes
1 answer

React, Ember-data

I use ember-data in my ember.js projects, now I learn react. My question is: what technics are used in react to achieve the same functionality as ember-data? I'd like to: have something like models if I've changed model in one place, changes are…
Costa
  • 634
  • 3
  • 18
12
votes
2 answers

Ember Data has duplicate records

In my app, a user can create a message and send it. When the user sends the message, the message is created with createRecord and the server replies with 201 Created if successful. Also, the user can get messages from other users through a…
Marc-François
  • 3,900
  • 3
  • 28
  • 47
12
votes
3 answers

Ember Data model's errors property (DS.Errors) not populating

I'm using Ember Data and I can't seem to get the model's 'errors' property to populate with the error messages from my REST API. I'm pretty much following the example at this guide: http://emberjs.com/api/data/classes/DS.Errors.html My app looks…
Johnny Oshika
  • 54,741
  • 40
  • 181
  • 275
12
votes
3 answers

Ember Data: Saving relationships

I need to save a deep object to the server all at once and haven't been able to find any examples online that use the latest ember data (1.0.0-beta.4). For example, with these models: (jsfiddle) App.Child = DS.Model.extend({ name:…
Jeremy Gillick
  • 2,560
  • 3
  • 27
  • 35
12
votes
3 answers

How can I get Java / Spring MVC to return jsonapi.org ID based format?

I am implementing a JSON API to be used by the Ember-Data REST Adapter. The Ember-Data REST Adapter needs the JSON returned to follow this format: http://jsonapi.org/format/ Ember-Data…
Sparkling Ideas
  • 195
  • 1
  • 10
12
votes
6 answers

How to reload an async with links hasMany relationship?

Lets say we have Post = DS.Model.extend({ comments: DS.hasMany({async: true}) }) Comment = DS.Model.extend({ post: DS.belongsTo() }) and I have to use the links feature because otherwise I get a 414 error due to too much comments on a…
sly7_7
  • 11,961
  • 3
  • 40
  • 54
12
votes
4 answers

EmberJS: The best way to reload controller's model based on another property?

What is the best way to reload model for a current controller based on another property? For example: I have a post controller. Author can have only one post. I want to reload post creating form if currentAuthor property changes. I've tried that…
somebody32
  • 179
  • 1
  • 1
  • 9
12
votes
2 answers

Loading JSON object into Ember Data, e.g. Embedding JSON into the page on load and populating the store

My application embeds initial data into the html so that Ember does not need to send extra http requests on initialization. I am using the latest Ember data and I have not been able to succesfully take a JSON object, which is the same as Active…
Ryan Haywood
  • 549
  • 1
  • 8
  • 21
12
votes
1 answer

Difference between Ember objects and Ember Data ones

What's the difference between Ember Objects and the ones from Ember Data? I know that I should use Ember Data models when there is some data on the server, but when and where should I use either of them?
wryrych
  • 1,765
  • 4
  • 20
  • 31
12
votes
2 answers

Architecture for data layer that uses both localStorage and a REST remote server

Anybody has any ideas or references on how to implement a data persistence layer that uses both a localStorage and a REST remote storage: The data of a certain client is stored with localStorage (using an ember-data indexedDB adapter). The locally…
Panagiotis Panagi
  • 9,927
  • 7
  • 55
  • 103
12
votes
2 answers

Ember Data: Saving a model with an association in one request

I have two ember models with a relationship like this App.Foo = DS.Model.extend bar: DS.belongsTo("App.Bar", embedded: true) App.Bar = DS.Model.extend primaryKey: "blah" blah: DS.attr "string If I create and save a new record like…
Charlie
  • 10,227
  • 10
  • 51
  • 92