Created
March 10, 2015 22:01
-
-
Save cahlan/d9acb73e1ab56e980cc2 to your computer and use it in GitHub Desktop.
simple promise API for handing success/error/other in NG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//controller.js | |
myService.getStuff().then(function() { | |
//upon deferred.resolve | |
}).catch(function(err) { | |
//upon deferred.reject | |
}).finally(function() { | |
//no matter what | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment