mardi 24 avril 2018

Ember promise - accessing value

I am working on an Ember application..

I have a service that looks like this

let downloadMethod = this.get('service1')
  .fetch(id)
  .then(res => {
    console.log("res", res.agenda.method.value)
    res.agenda.method.value
 });

console.log("downloadMethod", downloadMethod);

when I try to access this -- the console log for downloadmethod shows a promise -- but inside the then -- res comes out as the string value I need.




Aucun commentaire:

Enregistrer un commentaire