Presenting my controller
RegisterController.$inject = ['$location', '$scope', 'Authentication'];
function RegisterController($location, $scope, Authentication){
var vm = this;
vm.register = register;
function register(){
Authentication.register(vm.email, vm.password, vm.confirm_password, vm.username);
}
function display_registration_error(error_list){
console.log("This seems odd")
}
}
Introducing my service
function Authentication($cookies, $http, RegisterController){
var Authentication = {
register: register
};
return Authentication;
// Registration process
function register(email, password, confirm_password, username){
return $http.post('/api/v1/accounts/',{
username: username,
password: password,
confirm_password: confirm_password,
email: email
}).then(registerSuccess, registerError);
}
function registration_failure(response){
error_list = response["data"];
RegisterController.display_registration_error(error_list);
}
}
The sequence is as follows register (controller)
-> post (service)
-> registration_failure (service)
->
display_registration_error (controller)
I suspect this might be causing the error
Error: [$injector:unpr] Unknown provider: RegisterControllerProvider <- RegisterController <- Authentication
Why is this error occurring and can it be resolved?