This is a snippet of code related to node.js:
app.get('/payees', function(req, res)
{
var categoriesPromise = Category.getAllCategories();
var payeesWhereNullPromise = categoriesPromise.then(function() {
return Payee.getAllPayeesWhere({categoryId:null})
})
payeesWhereNullPromise.then(function(payees) {
var categories = categoriesPromise.value();
res.render('payees', {categories: categories, subcategories: [], payees:payees});
})
});
This code snippet is used on the front end side:
{{#each payees as |payee|}}
{{#each categories as |category|}}
category.name
{{/each}}
{{/each}}
Although these codes work perfectly when executed separately, combining them does not produce the desired result.