Created
September 2, 2015 19:30
-
-
Save zontafil/04169279055c5d1cb736 to your computer and use it in GitHub Desktop.
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
| var q = require("q"); | |
| module.exports = { | |
| test: function(req,res){ | |
| q() | |
| .then(function(){ | |
| return func1(); | |
| }) | |
| .then(function(){ | |
| res.send("ok!!!") | |
| }) | |
| .catch(res.serverError); | |
| } | |
| }; | |
| function func1(){ | |
| return q.promise(function(resolve,reject){ | |
| q() | |
| .then(function(){ | |
| lol.copter(); | |
| resolve(); | |
| }) | |
| .catch(reject); | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment