Unknown provider: 'emails Provider'


#1

The following error keeps returning for me, I can't seems to get it to work, any advice?

Angular documentation for the error:
https://docs.angularjs.org/error/$injector/unpr?p0=emailsProvider%20%3C-%20emails%20%3C-%20HomeController

controller code:

  app.controller('HomeController', ['$scope','emails', function($scope, emails) {`
  
         emails.success(function(data){
    
         $scope.emails = data;
    
     });
  
  }]);

service code:

`
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; 
          }); 
}]);`

#2

Found the error, the emails service was never defined because I was trying to assign it with an '=' sign


#3

I also noticed a stray character in your controller: `

Incorrect:

  app.controller('HomeController', ['$scope','emails', function($scope, emails) {`
  
         emails.success(function(data){
    
         $scope.emails = data;
    
     });
  
  }]);

Correct:

  app.controller('HomeController', ['$scope','emails', function($scope, emails) {
  
         emails.success(function(data){
    
         $scope.emails = data;
    
     });
  
  }]);

#4

CQUAD4   1       1       1       2       19      18      0.      0.

testing