I want to use a simple loop like for(int i=0; i<10; i++){}
.
How do I use it in the Jade engine? I'm working with Node.js and use the expressjs framework.
Jade is a template engine for node. js and the default rendering engine for the Express web framework. It is a new, simplified language that compiles into HTML and is extremely useful for web developers. Jade is designed primarily for server-side templating in node.
The names of the variables in your Pug file become siteColors and siteNames . To set the entirety of an HTML element equal to a variable, use the equals operator = to do so. If your variable needs to be embedded inline, use bracket syntax #{} to do so.
for example:
- for (var i = 0; i < 10; ++i) { li= array[i] - }
you may see https://github.com/visionmedia/jade for detailed document.
Using node I have a collection of stuff @stuff
and access it like this:
- each stuff in stuffs p = stuff.sentence
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With