As a real beginner in EJS, I have two charts in my html page, so I want to use my partial twice:
<% include partials/spider-chart.ejs %>
You can pass single as well as multiple data here is how to do it
In render funtions
We can pass multiple data as an object like this
app.get("/account", function(req, res) {
res.render("account", {
name: 'Jon Snow',
age: 35
});
});
And then can access the data inside account using ejs simple template tags like this
your age is <%= age %> hello <%= name %>
In Partial views
Pass the data like this
<%- include('partials/logout', {name='triyon'}) %>
And access it like we did above
logged out <%= name %>