Open tzookb opened 8 years ago
router.get('/page', function(req, res, next) {
res.render('pages/page', {
partial: function () {
return 'whateverPartial'
}
});
});
When using dynamic partials, '(partial)' must be a function. See here: http://handlebarsjs.com/partials.html#dynamic-partials
I want to include a partial based on a variable I pass to the view
example:
now in the view:
I browsed all over the web and found this solution, but it doesn't work. it said for placing variable instead of a string do like this
but it gives me this error:
any ideas how to solve that?