I'm encountering a 'syntax error: unexpected identifier' and my browser seems to be getting stuck in a loop after executing this code. I figured incorporating setInterval for delaying API requests was a sound strategy according to the API request guidelines.
var tempArray = [];
var arr = [];
//angular controller
for (var i = 0; i < 10; i++) {
setInterval($http.get(url).success(function(data) {
tempArray.push(data);
arr.push(tempArray);
}), 1000);
}