and if yes, what is the syntax? My goal is to prepend an 's' to the word 'comment' when there is more than one. in an jQuery.ejs template in a JMVC app. The following breaks. I can't find any docs for conditionals...
<%=commentsNumber%> comment<% if (commentsNumber > 1) { %> s <% } %>
For others that stumble on this, you can also use ejs params/props in conditional statements:
recipes.js File:
app.get("/recipes", function(req, res) {
res.render("recipes.ejs", {
recipes: recipes
});
});
recipes.ejs File:
<%if (recipes.length > 0) { %>
// Do something with more than 1 recipe
<% } %>