Użyj zmiennej w Jade
Pracuję z Jade i Express i chciałbym użyć zmiennej w mojej instrukcji include. Na przykład:
app.js
app.get('/admin', function (req, res) {
var Admin = require('./routes/admin/app').Admin;
res.render(Admin.view, {
title: 'Admin',
page: 'admin'
});
});
layout.jade
- var templates = page + '/templates/'
include templates
Kiedy to zrobię, otrzymuję błądEBADF, Bad file descriptor 'templates.jade'
Próbowałem nawet
include #{templates}
bezskutecznie.