I am using node.js express 4
at my index.jsindex.js routes file I have this
router.get('/', function(req, res, next) { res.render('index', {items: myItemsdocs}); }}; at my index.hbsindex.hbs view I'm trying to use items as a javascript variable
<script type="text/javascript"> var jsItems = items; var name1 = jsItems[Object.keys(jsItems)[0]].itemName; alert(name1); </script> but nothing happens .. how can I use items object I have in the client side javascript ?
my template engine is express-handlebars