mercredi 9 août 2017

RSVP.hash - promise Not works like returning a object without promise

In my model I am retuning a data without a promise like :

import Ember from 'ember';

export default Ember.Route.extend({
  model: function(params) {
    return this.store.peekRecord('card-list', params.id ); //works
  }
});

It works fine. But when I add the RSVP promise, I am not getting the data to my models.

import Ember from 'ember';

export default Ember.Route.extend({
  model: function(params) {
    return Ember.RSVP.hash({
        model: this.store.peekRecord('card-list', params.id ) //not working
    })
  }
});

What is the issue to add a promise here? Or what is the correct way to resove the promise here?

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire