I'm a beginner in node.js.
My index.ejs
file has an included header.ejs
file. Everything works well except that I cant pass values to the variable status
in header.ejs
.
index.ejs
<html>
.
.
<title> <%= title %> </title>
.
.
<% include ../partial/header.ejs %>
.
.
</html>
header.ejs
<header>
.
.
<p>logged in status: <%= status %> </p>
.
.
</header>
app.js
.
.
.
app.get('/', function(req, res)
{
// not working :(
res.render('index', {
"status":"loggedin",
"title":"home"
});
});
.
.
.