Thứ Năm, 15 tháng 6, 2017

Condition statement not work in ejs

Condition statement not work in ejs

Condition statement not work in ejs
Condition statement not work in ejs

If your condition statement like
<% if(message) { %>
    <p><%= message %></p>
<% } %>

I think you shoud change your code become
<% if(typeof message !== "undefined") { %>
    <p><%= message %></p>
<% } %>

Good luck!!!
Previous Post
Next Post

post written by: