Update loaded value with node.js express

81 Views Asked by At

Express view:

app.get("/", function (req, res) {
    res.render("index", { addons: addons });
});

Jade template loop

each addon in addons

How would update that addons loop after the initial load using appjs/node.js/express/jade?

1

There are 1 best solutions below

0
On BEST ANSWER

You'd have to write some AJAX code. The way you'd do it might look something like this:

app.get('/addons', function(req, res) { res.json({ addons: addons }); });

Then, in your jade template, write some code which makes an AJAX request to your /addons URL, parses the JSON response, then loops over it.