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
Post a Comment