i want to be able to pass a global object that i will later on be use for whatever to a jade template
lets say:
app.get("/", function(req, res){
var options = {
chGlobal : {// this is the object i want to be a global
"property1" : 1,
"property2" : 2,
"property3" : 3,
}
};
jade.renderFile(__dirname +'/tpl/main.jade', options, function (err, html) {
console.log(err, html);
if (err)
{
throw err
}
else
{
res.send(html);
}
});
});
i would like to be able to use "chGlobal " in other scripts that are loaded. as if chGlobal was defined in the global scope.
Thanks