How to fix my promise return here for this function?
问题 I have an array of tags which may contain up to 3 items. Next I pass tags into my getTagQuotes function and am trying to set a promise variable to it. Right now I'm getting promise is undefined. // If there are tags, the wait for promise here: if (tags.length > 0) { var promise = getTagQuotes(tags).then(function() { console.log('promise =',promise); for (var i=0; i<tweetArrayObjsContainer.length; i++) { chartObj.chartData.push(tweetArrayObjsContainer[i]); } chartDirective = ScopeFactory