9
I have the following code in Angularjs but I have the error:
Error: [$injector:unpr] Unknown Provider: Authenticationprovider <- Authentication
My code is this:
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 doesn’t he identify Factory Authentication
?