Answer the question
In order to leave comments, you need to log in
How not to pass the same thing to res.render()?
There is a master template
res.render('index', {
title: title
menu : menu
})
res.render('other', {
title: title
menu : menu
})
Answer the question
In order to leave comments, you need to log in
# index.js
app.locals.title = title;
app.locals.menu = menu;
# view.js
res.render('index');
# other.js
res.render('other');
// index.jade
.title=title
.menu
.container=menu
res.locals
for the current request.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question