I have a promise in a loop, and I don\'t know how to pass some scope variables into the promise handler.
for(var i in superarray){ MyService.get(superarray[i
By the time your callback is run, i will refer to the last element in your array. You can use a closure and capture the current value of i:
i
for (var i in superarray){ (function(j) { MyService.get(superarray[j].externalID).then(function(r) { console.debug(j); }); })(i); }