Currently I'm messing around with Node and EJS templates.
However I have hit a problem. Im building up a page made up of multiple components and im calling these components into the index page like so:
<% include components/header.ejs %>
My question is how can I pass data (json) to that specific include?
I want to be able to reuse components however to show different content coming from json.
Thanks
Try:
<%- include('components/header.ejs', {data: 'data'}); %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With