search

Home  >  Q&A  >  body text

Does ejs support if else syntax?

Just started using ejs template and found out

<% if(...) { %> xxx <% } %>

But if

is added after
<% if(...) { %> xxx <% } %><% else { %> xxx <% } %>

The compilation directly reports an error. Does ejs not support else syntax?

漂亮男人漂亮男人2733 days ago780

reply all(1)I'll reply

  • 某草草

    某草草2017-05-31 10:42:46

    if’s } is placed in front of else

    <% if(...) { %> xxx <% } else { %> xxx <% } %>

    reply
    0
  • Cancelreply