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

Helper and returning the resolved value of a promise

$
0
0

@fguillen wrote:

I have this Helper:

export function myHelper(params) {
  let myObject = params[0];
  return myObject.myMethod();
}

But this is sending this error to console:

my-helper.js:8 Uncaught TypeError: myObject.myMethod is not a function

I think it is because myObject is an unresolved promise.

I have tried this:

return myObject.then((myObject) => { return myObject.myMethod(); });

But it is not working.

How can I return the resolved value of a promise?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4827

Trending Articles