0

I have this piece of code where the response status code is 403. The problem is it will never fire the second function, it simply does nothing.

I've seen similar errors but people were using interceptors, which I'm not.

 Itens.signUp($scope.user, confirmation).then(function (response) {
   console.log('success');
}, 
 function (response) {
   console.log('error');
});
5
  • You've got a syntax error in there. Please fix that and show us your actual code. Commented Sep 2, 2016 at 1:39
  • "people were using interpreters, which I'm not." - what does that mean? What are you using then? Commented Sep 2, 2016 at 1:41
  • Fixed that. Interceptor* Commented Sep 2, 2016 at 1:53
  • OK. Please show us the implementation of your signUp function, otherwise there's no way to tell you what you did wrong. Commented Sep 2, 2016 at 1:58
  • 1
    @Bergi I'm ashamed to say that but it was only a syntax error. thanks! Commented Sep 2, 2016 at 2:03

1 Answer 1

1

The below isn't formatted right.

.then(function(response) {
    console.log('success');
  }),
  function(response) {
    console.log('error');
  };
}

It should be like this:

.then(function(response) {
  console.log('success');
}, function(response) {
  console.log('error');
});

Alternatively you could also do this:

.then(function () {
  console.log('success');
})
.catch(function () {
  console.log('error');
});
Sign up to request clarification or add additional context in comments.

2 Comments

I'm ashamed for that, but it took me almost a day to realize a syntax error. Thanks mate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.