خرید بک لینک

Vote count: 0

the code is this

module.exports = {
index: function (req, res, next) {
    //get an array of all users in user collection
    Notification.find(function foundNotification(err, notifications) {
        if (err) retu next(err);
        var elusuario=[];
        User.findOne(2, function foundUser (err, user) {
            if (err) retu next(err);
            if (!user) retu next();
            console.log(user);
            console.log("----------------------------");
            elusuario = user;
            console.log(elusuario);
        });
        res.view({
            notifications: notifications,
            elusuario: elusuario
        });
    })

}

};

That is the controller and in the console prints elusuario good but in the view the user hasn't values. why? i think is something is something related to the globals variables. but i dont know thanks

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 31 فروردين 1395 ساعت: 5:33

صفحه بندی