I am making a jade file like:
On the server side:
var html = jade.renderFile('ui/index.jade', {
printHello : function(){
console.log('Hello World');
}
});
On the client side in index.jade:
script(type="text/javascript").
var s =
s.printHello(); //Desired to print 'Hello world' on browser console
But it s.printHello()says that the Object object does not have the function 'printHello';
and console.log(s);// gives {} an "empty object";
Why is this so ??
And how do I make a printHellogift and work?
source
share