This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Shorthand for defining promise error handlers - $q.fail() #2048
Comments
+1. |
+1 fail! |
👍 |
Upvote for fail. |
this is not yet done. +1 for the fail method! |
+1 |
1 similar comment
👍 |
👍 : |
bolasblack
added a commit
to bolasblack/angular.js
that referenced
this issue
Aug 9, 2013
Now we can instead this promise.then(null, errorHandler) with this promise.catch(errorhandler) Closes angular#2048
Thanks @IgorMinar for merging this. |
Sweet! |
Is it possible to get another shorthand for when notification comes in, a shorthand for |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Kris Kowal's Q provides the fail() shorthand for defining error handlers.
Error handlers can then be defined as
instead of
... which feels a bit clunky.
I realize that Angular's $q is meant to be minimal and without the bells and whistles of Q, so this might not be worth adding to Angulars $q implementation.
If you consider that
fail()
would be feasible to include in Angular's $q, let me know and I will be happy to create a pull request with a patch!The text was updated successfully, but these errors were encountered: