I have the following code in AngularJS but I get the error:
Error: [$ injector: unpr] Unknown provider: AuthenticationProvider < Authentication
My code is as follows:
app.js
angular.module('app')
.controller('HomeController', function ($scope, Authentication) {
var usuario = { login : 'teste', senha : 'senha123'};
$scope.usuario = Authentication.autenticar(usuario);
});
authentication.js
angular.module('api.Authentication', [
'ngResource'
])
.factory('Authentication', ['$resource', function ($resource) {
return $resource(endpoint + 'users/authentications', {}, {
autenticar: { method: 'POST' }
});
}]);
What's missing? Why does not it identify the factory Authentication
?