I try to get from JSONPlaceholder data to display, and I need more than one $http.get , this is my code. The problem is, that from the second call I don't get any data
MyAlbum1.controller('albumList', function($scope, $http) {
$http.get('http://jsonplaceholder.typicode.com/albums').
then(function(response) {
$scope.albumDetails = response.data;
});
$http.get('http://jsonplaceholder.typicode.com/users').
then(function(response) {
$scope.albumUsers = response.data;
});
});
If I try for example to display in the partial view albumUsers.name it will not display. Only if I put first the $http.get('http://jsonplaceholder.typicode.com/users'). but then it will not display the albumDetails.id
So how do I get more than one http.get?
Thanks