m3l7
9/2/2015 - 7:30 PM

TestpromiseController.js

 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);
	})
}