I want to include Asp.Net Identity into my app.
But when I want to register a new user, I get an error on javascript side:
Cannot read property 'then' of undefined.
This is the code in my Controller: When I click the button to register the user, I get in the function below.
$scope.signUp = function () {
AuthenticationService.register($scope.registerData).then(function (response) {
...
},
function (response) {
...
});
};
And this is the code in my Service, which is called in the Controller above.
register: function (registerData) {
this.logout();
Restangular.all('api/account/register').post(registerData);
}
What am I doing wron? Can you help me to get the solution?
Your service method does not return the promise of what Resangular.all().post() is supposed to return. Its a q promise.