Questions tagged [ember-model]

Ember Model (EM) is a simple and lightweight model library for Ember.

Ember Model (EM) is a simple and lightweight model library for Ember. It intentionally supports a limited feature set. The main goal is to provide primitives on top of $.ajax that are required by Ember.

EM is still very much a work in progress, but it's flexible enough to be used in apps today. It was extracted out of an Ember app. Please see the issues section for a list of bugs and planned features.

Github repository

135 questions
1
vote
1 answer

"str is undefined" on findRecord

I have a problem with model and serializer. I've looked at the documentation and can't find a solution. My app is connected to a django rest api. Django response: { "id": 1, "url": "http://localhost:8000/users/1/", "username":…
carloscba
  • 13
  • 4
1
vote
0 answers

Ember error handling

My model looks like, App.Post=DS.model.extend({ id :some_id, comments:DS.belongsTo('comments',{async:true}); }) App.CommentsRoute=Ember.Route.extend({ model:function(){ var post = this.store.find('post',1); …
arun kumar
  • 11
  • 5
1
vote
1 answer

Returning Record and Other Models in EmberJS

With the following code, you can return multiple models (assuming you've previously fetched your data): model: function() { return Ember.RSVP.hash({ cars: this.store.peekAll('car'), owners: this.store.peekAll('owner'), …
Matt
  • 1,811
  • 1
  • 19
  • 30
1
vote
1 answer

Returning albums array to Ember Route But {{#each}} not working

Started learning ember. Trying to display list of albums in application.hbs. After returning the array values in Routes, I am not getting array object in {{#each}}. Please let me know what I am doing wrong. Routes import Ember from 'ember'; import…
Shakeeb Ahmed
  • 13
  • 1
  • 4
1
vote
0 answers

First route errors in Ember.js

I would like to handle errors that happen in the first route within ember and if the error action is called redirect to another route. How would i determine if this is a first route upon error being invoked and if it is a first route, re-route to…
1
vote
0 answers

Ember model inside models sub folder

I am using ember cli and Ember Data. My requirement is to keep ember model in Models sub folder. Ex. My Model Name is mymodel and have kept it inside app\models\myfolder\mymodel.js folder. store.find works with following syntax…
Manish
  • 21
  • 8
1
vote
0 answers

Ember-Model: Serializing data from multiple nested JSON levels

I have JSON that is structured like this: { "status": "success", "data": { "debtors": [ { "debtor_id": 1048, "debtor_contact_id": 1086, ... ... }, { "debtor_id": 1049, …
Grapho
  • 1,654
  • 15
  • 33
1
vote
0 answers

Ember - trying to access CompaniesController model data from UsersController or UsersRoute

I have simplified the story for brevity. I have 2 basic models, User and Company and display lists of each on separate templates. But on the Users list I want to have a drop down at top to filter what users are visible. For now I just want the list…
Nick Licata
  • 147
  • 11
1
vote
1 answer

Ember-Model: Help Debug - TypeError: cannot read property 'map' of undefined

Summary I am using Ember-Model and I need help debugging this error message.. it is actually two separate (but similar) error messages: TypeError: Cannot read property 'map' of undefined -and- Uncaught Error: Assertion Failed: TypeError: Cannot read…
Grapho
  • 1,654
  • 15
  • 33
1
vote
2 answers

How to map component's properties to the model?

In my Ember app I'm iterating through an array of models and rendering a component for each one: {{#each}} {{content-box provider=provider type=type author=author link=link createdDate=created_date media=media summary=summary text=text title=title…
silvenon
  • 2,068
  • 15
  • 29
1
vote
1 answer

Is there a way to perform rollback in ember-model?

I am trying to set up a some simple CRUD operations using ember-model. While editing a model in my app, I want there to be a "cancel edit" option. This should undo any changes that where made to the data, even if they were not saved to the store. I…
SuperPig
  • 70
  • 7
1
vote
0 answers

Access the parent from the child of a hasMany

I feel like I must be missing something obvious, but how does one access the parent object from within a child object defined by hasMany in the parent? We have a hierarchical data model. App has many Categories Category has many Layers All of our…
pjfingers
  • 51
  • 5
1
vote
1 answer

Injecting dependencies into an 'ember-model' Model and use of the MODEL_FACTORY_INJECTIONS flag

I previously asked a similar question here Injecting dependencies into an Ember model, but I now believe my issue is really around injection of dependencies into an 'ember-model' model. Even when I have set Ember.MODEL_FACTORY_INJECTIONS = true, I…
technicolorenvy
  • 486
  • 7
  • 16
1
vote
1 answer

EmberJs: How to save a model when belongsTo attribute is dirtied?

Given two models, how can I ensure that an update to the "child" object marks the "parent" object as "dirty" so that calling save on the parent object does not skip? Details Using ember-model, I have defined Person and Address models like so: …
bguiz
  • 27,371
  • 47
  • 154
  • 243
1
vote
0 answers

Extracting data from Ember-Model Embedded hasMany array

My issue is to get the content from an ember embedded hasmany array object. I am using ember model (https://github.com/ebryn/ember-model) library to get and post data from the server. The JSON returned contains embedded objects, but in my view, I…
Akk
  • 406
  • 1
  • 5
  • 17
1 2
3
8 9