Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodejs ejs include unexpected identfier

i'm using nodejs + express + ejs and i am having a problem when i try to include another view.

When I try:

<% include dochead %>

I get 'unexpected identifier';
when i try:

<% include /admin/global/dochead %>

I get 'include is not defined';

What is going on? Thanks

like image 900
André Alçada Padez Avatar asked Jan 13 '13 15:01

André Alçada Padez


1 Answers

Try

<%- include ('dochead') %>

or

<%- include ('admin/global/dochead') %>

set

app.set('view engine', 'ejs');
app.set('views', 'YOUR CUSTOM VIEW FOLDER PATH FROM ROOT FILE');
like image 162
Mohit Soni Avatar answered Nov 15 '22 07:11

Mohit Soni