Skip to content Skip to sidebar Skip to footer

$q.all Returns Undefined For All Values

I'm trying to wait on 3 promises but $q.all appears to resolve them at once and returns undefinedfor each single value, I can't figure out why: this.doWork = function() { var def

Solution 1:

You should not be doing .promise on promise object returned by get method, because you had already returned promise form get method.

$q.all([a, b, c])

When you're doing a.promise, b.promise & c.promise they all becomes undefined & then $q.all array become $q.all([undefined, undefined, undefined]) passing them to $q.all will give undefined result.

Post a Comment for "$q.all Returns Undefined For All Values"