Answer the question
In order to leave comments, you need to log in
How to update the value of the handlebars expression?
Index.hbs has an expression {{#each gifts}} , which iterates over the gifts object .
const fileContent = fs.readFileSync('./src/webapp/json/gifts.json', 'utf8');
const content = JSON.parse(fileContent);
exports.methodGet = function (request, response) {
response.render('index.hbs', {
gifts: content
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question