I have the following object:
{
"EekvB3cnwEzE":{
"name":"hi",
},
"Brv1R4C6bZnD":{
"name":"yup",
},
"kRwRXju6ALJZ":{
"name":"okay",
}
}
I am trying to add each of these items into an array. I do the following code but for some reason, I get back [] in my console.log
Could anyone help me figure out what's wrong?
$scope.items = [];
$http.get("/url").success(function(data) {
$.each(data, function(key, value) { $scope.items[key] = value; });
console.log($scope.items);
});