I have JSON file called twitData.json that looks like this:
I want to iterate over it using Handlebars and Express, and pass it to a partial to be implemented as html code. I have included the JSON file in server.js. I use res.render in server.js to try and pass the elements of JSON to the partial. Like this: res.render('twitPage', {twitData}) . and for my handlebars file I use
The partial I am using, twit.handlebars, looks like this. It needs two arguments. I am supposed to pass the arguments somehow using res.render.
The main parts I do not understand is what to put as the second argument in res.render, and what I should put for the context in the helper. Any ideas would be appreciated. If you need more info, I can supply.
here is twitPage.handlebars:
via DSATH
No comments:
Post a Comment