I'm trying to pass one piece of test data from routes/index.js:
/* GET Hello World page. */
router.get('/helloworld', function(req, res) {
res.render('helloworld', { title: 'Hello, World!', data: {'val' : 'This is a Test'}})
});
to views/helloworld.jade:
extends layout
block content
h1= title
p Welcome to #{title}
script(type='text/javascript').
var data = !{JSON.stringify(data)};
my results in the browser is:
Hello, World!
Welcome to Hello, World!data = ;
I'm not getting any error messages, but how do I get the data to show up in the browser?
Thanks.
Did you bother reading the documentation at all?
All plain text begins indented on a new line with a pipe character.
I can't actually tell what you're trying to do w/ the script but that's my best guess.