I am trying to render template data on my front end with ejs. This is currently my template:
<% data.urls && data.urls.countries.forEach(function (countries) { %>
<div class="card">
<div class="card-body">
<h3>Country Name: <img alt="" src="<%=Country.icon %>" /> <%= countries.name %></h3>
<h5>Categories</h5>
<ul>
<% data.urls.countries.categories.forEach(function(categories){ %>
<li><%= categories.name %></li>
<% }); %>
</ul>
</div>
</div>
<% }); %>
and I am trying to render that data on the front end through:
<% data.urls && data.urls.countries.forEach(function(countries){ %>
<%- include ('template', { data: data }); %>
<% }); %>
However, when I do so, there is no response. When I view the source code, there is not response, and it appears as if the code which should render the data on the front end (second code block) is not there. There is no error in the console, and I see the request come through the node server, but no response. Any idea?
Example of what I am trying to render is below:
question from:
https://stackoverflow.com/questions/65876721/response-data-not-rendering-despite-request-being-passed-through 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…