I am trying to partially download Mustache in express.js, but obviously I am having problems. Is it possible to use this EJS approach when a partial file of the form is included:
Node.js - EJS - including partial
I have a template file called index.html
<html>
<head>
<title>My Title</title>
</head>
<body>
{{>header}}
</body>
</html>
and header.mustache
<div class="header">
<div style="display: table-cell;padding-left: 10px;padding-top: 8px;vertical-align: middle;">
<img src="images/logo.png">
</div>
</div>
In express.js, my rendering function looks something like this:
app.get('/', function(req, res) {
res.render('signup.html', {
partials: {
header: partial('header.mustache')
}
});
});
I am new to this, but would like to somehow display or read the entire contents of the header.mustache for the header object. Is it possible?
source
share