text: var app=angular.module("tvApp",[]);app.controller("tvCtrl",function($scope,$http){$scope.onlineUsers=!0,$scope.offlineUsers=!0;var urlApi="https://api.twitch.tv/kraken/streams/",users=["freecodecamp","storbeck","terakilobyte","habathcx","RobotCaleb","comster404","OgamingSC2","thomasballinger","cretetion","noobs2ninjas","beohoff","sheevergaming","brunofin","ESL_SC2","pokemongo","sonyk0rzlol"],config={headers:{"Client-ID":"6grsfoul5e1to3apxihx6ufoviw6awd"}};$scope.online=[],$scope.offline=[],$scope.titleApp="Twitch.Tv Api Streamers",angular.forEach(users,function(user){$http.get(urlApi+user,config).success(function(data){if(data.stream)$scope.online.push(data);else{var urlOFF=data._links.channel;$http.get(urlOFF,config).success(function(dataOFF){$scope.offline.push(dataOFF)})}}).error(function(data,status){var chOut={stream:null,logo:null,display_name:user,url:"https://www.twitch.tv/"+user,status_account:"Account Closed"};$scope.offline.push(chOut)})})});