Seems to me that both does the same thing. Docs: deferred.always() deferred.then()
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It would seem that
deferred.then()allows you to pass two separate callbacks for success and failure, whereasdeferred.always()takesnnumber of callbacks which will all be called regardless of the outcome of the initial event.I would say use
deferred.always()in the cases where success/failure of the initial event are not important