0
をnodejs私は次のように私が起こっnodejs間違いでレンダリングいくつかのショーを行うために探していた。は、単一の関数で複数の翡翠をレンダリング
res.render ('header', {
title: 'demo'
});
res.render ('main', {
container: 'dataaa'
});
をnodejs私は次のように私が起こっnodejs間違いでレンダリングいくつかのショーを行うために探していた。は、単一の関数で複数の翡翠をレンダリング
res.render ('header', {
title: 'demo'
});
res.render ('main', {
container: 'dataaa'
});
あなたの代わりに
その後、//- layout.jade
doctype html
html
include ./head.jade
body
include ./main.jade
を
includeを使用する必要があります
res.render ('layout', {
title: 'demo',
container: 'dataaa'
});
the original idea is to obtain two collections to two files in jade
unoCollection var = db.get ('one');
unoCollection.findById (id, function (err, result) {
res.render ('header', {
name: result.name,
surname: result.surname,
});
});
unoCollection var = db.get ('two');
unoCollection.find ({}, function (err, result) {
res.render ('users', {
name: result.name,
surname: result.surname,
});
});
and jade
html
body
include header.jade
include usuarios.jade
It does not work this way there somehow?