i have a problem with my callbacks, i dont know how i get it back.
index: function(req, res,next) {
User.find().exec(function(err,users) {
if(err) {
//do something
}
res.locals.users = users
return true;
});
Country.find().exec(function(err,countrys) {
//save country
}
console.log(res.locals.users)
res.view({
users: res.locals.users,
country: countrys
user:res.locals.user
});
}
How can i get access to both objects?
Thank you