0
I’m calling an Amazon service and is giving problem, follow code:
Controller:
app.controller('MainController', ['$scope', 'emails', function($scope, emails) {
emails.success(function(data) {
$scope.email = data;
});
console.log($scope.email); }]);
Factory:
app.factory('emails', ['$http', function($http) {
return $http.get('https://s3.amazonaws.com/codecademy-content/courses/ltp4/emails-api/emails.json')
.success(function(data) {
return data;
})
.error(function(err) {
return err;
}); }]);
On the console appears:
Typeerror: $http.get(...). Success is not a Function
What can it be?
This way also worked, thank you Hiago. :)
– Rafaela Cordeiro
;) arrange Rafaela
– Hiago Souza