我正在使用Jade和Express,我想在我的include語句中使用一個變量。例如:在Jade中使用變量包括
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
當我這樣做,我得到EBADF, Bad file descriptor 'templates.jade'
我甚至嘗試
include #{templates}
錯誤無濟於事。
我一直在尋找這個問題,以及。驚訝這個功能尚未添加。分叉回購看看實現這個功能是多麼困難。 –