I'm unable to make http calls
Here's my code:
testCtrl.$inject = ['$scope', '$http'];
function testCtrl($scope, $http) {
$scope.loadPeople = function($http) {
return $http.get('https://randomuser.me/api/?results=10')
.then(success);
function success(response) {
return response.data;
console.log(response.data);
}
// $http({
// method : "GET",
// url : "https://randomuser.me/api/?results=10"
// }).then(function mySuccess(response) {
// $scope.myWelcome = response.data;
// }, function myError(response) {
// $scope.myWelcome = response.statusText;
// });
}
$scope.loadPeople();
}
I'm unable to make http calls
Here's my code:
testCtrl.$inject = ['$scope', '$http'];
function testCtrl($scope, $http) {
$scope.loadPeople = function($http) {
return $http.get('https://randomuser.me/api/?results=10')
.then(success);
}
$scope.loadPeople();
}