$q.all is resolving before the returns

后端 未结 1 1965
有刺的猬
有刺的猬 2021-01-21 06:58

The $q.all is resolving before either of its functions has resolved.

I\'m uploading two files to azure blob storage using $.ajax (I couldn\'t get $http to w

相关标签:
1条回答
  • 2021-01-21 07:15

    After doing some research and thinking about the various comments from @charlietfl, the only way I could get the $q.all to work properly is do assign the function call to a variable and then push it into the array that is being passed to q.all.

    for (var i in result.photos)
    {
        var output = doPhotos(result, i);
        doPhotosArray.push(output);
    } 
    

    The various examples that I used for reference seem to indicate that the code in my original question should work but doesn't.

    0 讨论(0)
提交回复
热议问题