Is there any best practice how to implement controller chaining in Sails.js? For example I have controller like this:
FirstController.js
var FirstController = {
getPage: function(req, res){
var page = 1;
res.json({
page: page
});
}
};
SecondController.js
var SecondController = {
getPageSecond: function(req, res){
//how to call FirstController and then use that result?
}
};
I usually use Function Constructor to create Constructor first then my controller can call it, but is it the best way? Sometimes I also have to "chaining" blueprint's action, so I re create blueprint and make it become method in my Constructor. Is there any best practice how to make our controller to be more reusable?