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

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -