http://codepen.io/rcidaleassumpo/pen/eNEjGY?editors=001 That's the link for the code. Below I first used the forEach to combine the nicknames with the base link, so I could get the fullLink to make the call for with the $http. But then when I tried to make the call, and post into a empty array, things didn't work as I expected, that's why I need your help.
From what I could understand the information that I could get from the $http request, doesn't leave the request itself, and the infos arrays remains empty.
var app = angular.module('myApp', []);
app.controller('mainController', function($scope, $http){
$scope.channels = ["freecodecamp", "storbeck", "terakilobyte", "habathcx","RobotCaleb","comster404","brunofin","thomasballinger","noobs2ninjas","beohoff"];
var url = 'https://api.twitch.tv/kraken/channels/';
$scope.fullLinks = [];
$scope.infos = [];
$scope.channels.forEach(function(channel){
$scope.data = '';
var link = url + channel + '?callback=JSON_CALLBACK';
$scope.fullLinks.push(link);
});
$scope.fullLinks.forEach(function(link){
$http.jsonp(link).success(function(data){
var obj = {}
obj.url = data.url;
$scope.infos.push(obj);
});
});
console.log($scope.infos);
});