javascript - include a view file that it's name is in a variable into an EJS template -
i use method include ejs
file in template:
<% include header %>
but if header
variable, errors. how can include file it's name in variable ejs
template?
you can't:
https://github.com/tj/ejs/issues/93
the issue opened in 2013 , never resolved.
however, in version 2 call include
as plain function:
<%- include(header) %>
Comments
Post a Comment