Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4826

Spezify the model at findRecords/query?

$
0
0

@FlorianKrippner wrote:

Hej Ember Community :upside_down_face:, I am trying to get data from by backend in ember. The Data is represented as an array. So i need to use one of the methods thats return an DS.PromiseArray.

I am using currently for that this code:

  myStore.query('activeclassinstances', {}).then(function(activeclassinstances) {
    activeclassinstances.forEach(function(element) {
      //dosomething
    });

My problem is now, that my backend give me other data if i use a path like this: activeclassinstances/5 This data is still an array, so i cant use the other methods.

if i try something like this:

 myStore.query('activeclassinstances'/5, {}).then(function(activeclassinstances) {
        activeclassinstances.forEach(function(element) {
          //dosomething
        });

then he cant match the model. is there a option to spezify the model for a query somewhere different? or other way around that you spezify the url different. so the model has not the same name like the url ?

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles