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

How to sort an ArrayController backed by Ember-Model?

Prior to using Ember-Model sorting my ArrayController with sortProperties and sortAscending worked as expected. Lately I switched to Ember-Model and the sorting feature doesn't work anymore. Code so far: App.Movie = Ember.Model.extend({ rating:…
user836968
1
vote
1 answer

Creating New Record using Ember-Model

I struggled for hours trying to get this to work using Ember-Data with no result, so thought I give Ember-Model a try; still no joy. I have the following: App.Item = Ember.Model.extend({ itemName: Ember.attr(), }); App.Strat =…
user2436810
  • 151
  • 5
1
vote
2 answers

Updating a view whenever there's new records with Ember-Model

I have a simple Ember.js app. There's an application view and inside that view there's a results view. I'm using ember-model to fetch JSON from the server that way: Map.Winery = Ember.Model.extend({ name: Ember.attr(), address: …
Tommy B.
  • 3,591
  • 14
  • 61
  • 105
1
vote
1 answer

Failed to sort data in emberjs

I have list of price which i want to sort based on selection of drop down.I want to sort data in both ways ascending and descending. On selection of "Low to high", I want to sort list of price in descending order and on selection of "High to low",…
Sachin
  • 2,321
  • 11
  • 31
  • 49
1
vote
2 answers

Can't get data from a computed property with ember-model

I am making an app with ember.js and ember-model I have a model named Plugin defined as follows: Eme.Plugin = Ember.Model.extend id: Ember.attr() name: Ember.attr() description: Ember.attr() downloads: Ember.attr() tags:…
JUO
  • 626
  • 1
  • 7
  • 19
1
vote
1 answer

Ember.js ember-model leak issue?

While working on a simple gallery app I realized that my ember app is slowly eating up memory. I created a very simple app to demonstrate the issue: index.html app.js test.js. Test setup: Test 1 enters a route and then returns back: Link to Test…
david8401
  • 379
  • 1
  • 3
  • 11
1
vote
1 answer

OneToOne relationship with ember-model

How to implement a one to one relationship with ember-model ? I have tried the following code but it does not work. App.Book = Ember.Model.extend({ id: Ember.attr(), title: Ember.attr(), name: Ember.attr(), author: App.Author }); App.Author…
fvisticot
  • 7,936
  • 14
  • 49
  • 79
0
votes
1 answer

Ember SPA application with related models

Lets say we are working on a recipe app and we have 2 get requests initially. /ingredients/ /recipes/ These create the recipe and the ingredient model. Now recipes are made of ingredients and amount of each ingredient. And ingredients only have…
0
votes
0 answers

When should / shouldn't we use Ember Model for displaying data?

I would generally like to understand, when should we use Ember Model to storing data and when should we declare data within components to be used by templates for rendering? For instance, I have a report component and the associated template shows…
Son
  • 1
0
votes
2 answers

How to enable ds-rollback-attribute in ember?

Ember has method rollbackAttribute() which is very similar to the default method rollbackAttributes(). The difference is rollbackAttribute() can be used to rollback ONLY specific model attribute. By default this method is not available and to use it…
spirito_libero
  • 1,206
  • 2
  • 13
  • 21
0
votes
2 answers

Ember Data: Pushing the data to the store will not replace the changedAttributes of the record?

I am using Ember Data and I have a model say my-model. I am having a realtime notification server to update my application if there is any change for a record. When I am editing an attribute of my-model from UI, the model has some changedAttributes…
Pragatheeswaran
  • 120
  • 1
  • 9
0
votes
2 answers

How to achieve sort functionality in Ember 2.1.8 for Async=true relationships

I have following computed properties, tempate and a model where there are relationships which are async=true ArrayController is used to sort the people-cards 1st after upgrading to 2.1.8 its not working. how to achieve this ? computed properties …
0
votes
0 answers

Refresh Ember model when service method is executed

In a route, I would like my model ,where I called this.get('store'), to be dependent of a service. So when one of my value in the service changes, my model will be automatically refreshed. I don't know if this is possible with a service and if it is…
El Poisen
  • 121
  • 1
  • 8
0
votes
2 answers

Ember model access to belongsTo property return null

I have a model Person with this property : address_fk: DS.belongsTo('address') refering to an Address model. In the adress model, there are several properties such as zip_code , building ... My goal is to create a computed property in Person to…
El Poisen
  • 121
  • 1
  • 8
0
votes
1 answer

Ember.computed.sort on belongsTo properties

I am trying to use Ember.computed.sort and can't figure out how to sort by the name of a belongTo property. I have been on GOogle for hours and can't find the right combination. help please! // my model export default DS.Model.extend({ …
Rick
  • 21
  • 1
1 2 3
8 9