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
2
votes
1 answer

EmberJS: why are destroyed records committed back to the server?

Sometimes in my Ember app I create some records with createRecord, but I don't want to store all of them on the server. So I call destroy on the objects I don't need before calling store.commit(). Yet, they are sent to the server nonetheless. How do…
PJC
  • 997
  • 7
  • 21
2
votes
1 answer

ember-data how to reload/sort store records

Is there a way to reload the whole store in ember-data? Or to sort items inside? It should go like that: user clicks "add" button new record is added store is commited user is transmited to the state where items are listed his new entry is there in…
greg
  • 1,857
  • 2
  • 20
  • 32
2
votes
0 answers

Ember-Data rev. 11 <-> Error: XML instead of JSON as content type

Why is ember requesting XML instead of JSON? XML Response according to firebug: XML-processing defect: No element found address: moz-nullprincipal:{664ded3f-7063-4f92-b404-3895f595c584} Row No. 1, Column 1: [my translation into English] Ember Data…
Daniel
  • 111
  • 1
  • 8
2
votes
1 answer

camelCased Model names

does anyone know if there is a recent problem with camelcased properties. I have a model like this: var attr = DS.attr; App.Users = DS.Model.extend({ firstName: attr('string'), phone: attr('string'), email: attr('string') }); In my…
Alexander Hauer
  • 73
  • 2
  • 10
2
votes
2 answers

How to find objects in model using a match in Ember.JS?

I am starting out in Ember.JS, but I think I got myself a nice question. I have a working list of items on the left, and a search field on the right. So on the KeyUp event, I send the value of the textfield to the model , to find matches as…
user1519082
  • 33
  • 1
  • 2
  • 4
2
votes
0 answers

Ember.js Injecting a Dependency Into Controllers, Routes and Data Store Adapter

I'm trying to inject a dependency into a data-store adapter, so it's available from its "init" method, onwards, but I'm having trouble. I'm the method outlined in http://livsey.org/blog/2013/02/10/integrating-pusher-with-ember/ to create a "Pusher"…
Michal Charemza
  • 25,940
  • 14
  • 98
  • 165
2
votes
0 answers

The Rest Adapter does not fire GET request to fetch related model attributes

In an application trying to simulate a newsfeed, I have the following three models. Feed - {name:string, posts:hasmany(Post model)} Post - {text:string, comments:hasmany(Comment model), feed:belongsto(Feed model)} Comment - {text:string,…
Pavithra Kodmad
  • 255
  • 1
  • 6
2
votes
1 answer

Ember array data

What is the proper way to use an array in an Ember data model? Tom Dale points out that ember has "embedded hasOne relationships" in this comment, but I am not able to find any documentation or examples of this in action. For example I have a…
Mike
  • 12,359
  • 17
  • 65
  • 86
2
votes
1 answer

Ember.js Recommended Way to Remove Items From a Collection and Persist to REST

I've followed the PeepCode tutorial on Ember.js, and am extending it to remove items from the tab. I'm also implementing a simple RESTful interface on the server to persist changes, and am using DS.RESTAdapter. There are 2 relavent…
Michal Charemza
  • 25,940
  • 14
  • 98
  • 165
2
votes
1 answer

Emberjs: How do I filter users by any property using routes

I have the following route and model setup. All my users display fine using a template and displays the firstName and email as expected. However I am unable to filter by firstName or email when routing similar to how :user_id works. (I am using the…
KALBB
  • 105
  • 1
  • 6
2
votes
2 answers

Mixing different Models on one Route

We are using Ember together with Ember-Data and are stumped by following setup: There is a parent object (Epic) which has a number of children (UserStory). We have modelled this accordingly using ember-data: App.Epic = DS.Model.extend({ name:…
Stefan
  • 990
  • 1
  • 6
  • 10
2
votes
1 answer

Ember.Data reloading content, UI not updating

We're using Ember.Data rev 11. Our relationships are like so: Social.Account = DS.Model.extend({ name: DS.attr("string"), username: DS.attr("string"), messages: DS.hasMany("Social.Message"), }); Social.Message = DS.Model.extend({ …
commadelimited
  • 5,656
  • 6
  • 41
  • 77
2
votes
2 answers

use ember-data or ajax calls

I'm looking for some advise on whether to use ember-data or not. My preference would be to use it, but it also has to make sense. My main set of records will be lat/long records, that need to be displayed on a map. The records I get will depend on…
Rudi
  • 1,577
  • 3
  • 16
  • 42
2
votes
2 answers

Calling deleteRecord() too often or too fast at a time?

I want to delete all records of the model "Article" (around five pieces). I'm doing it like that: CMS.ArticlesController = Em.ArrayController.extend deleteAll: -> @get("content").forEach (article) -> …
kraftwer1
  • 5,253
  • 10
  • 36
  • 54
2
votes
1 answer

Model code duplication when using Ember.js

I'm considering switching to Ember.js for one of my Sinatra applications. Our current setup is using server-side Handlebars rendering along with RESTful routes for CRUD operation and Websockets for push notifications. My main concern, however, is…
user2398029
  • 6,699
  • 8
  • 48
  • 80