javascript - Node EJS passing data to an include -


currently i'm messing around node , ejs templates.

however have hit problem. im building page made of multiple components , im calling these components index page so:

<% include components/header.ejs %> 

my question how can pass data (json) specific include?

i want able reuse components show different content coming json.

thanks

try:

<%- include('components/header.ejs', {data: 'data'}); %> 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

c++ - How to test/verify that zero-initialization takes place -

node.js - Webpack/TypeScript Raising Errors When node_modules is Excluded -