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 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -