javascript - success&error vs. then&catch in AngularJS $http -
in answer this question said
you not want ever use success , error (prefer .then , .catch instead
and
$http returns $q promise addition of success , error handlers - however, these handlers not chain , should avoided if/when possible
and success , error unwraps response object, can access status , such anyway doesn't seem relevant.
i found this blogpost author talks confusion other frameworks' ajax query commands , "you might not know you're doing ajax stuff.", don't understand.
so i'm little fuzzy on reasoning behind "use then/catch instead of success/error". because of chaining errorcatching? reasons outlined sufficient , don't it? success/error fine in situations? considerations choice?
in angjs tutorials i've read , answers here on stackowerflow saw success/error iirc . . .
Comments
Post a Comment