Jimbo
Jimbo

Reputation: 81

jade templating engine iteration not working

Ok, I'm positive that I'm making a really stupid mistake but I've been working on this for a while now and am drawing a blank. I've got this so far in my jade template-

extends layout.jade
block content
    h1 Hello World!
    p.
        This is a hypothetical paragraph that I would use to write this.
        - var n = 0
        ul
            while n < 4
                li= n++

I'm rendering it with express and res.render- It comes across fine but the loop and the ul isn't working. It just comes across as plain text. Everything else in the jade template works as expected. What am I missing?

Upvotes: 0

Views: 179

Answers (1)

user4200451
user4200451

Reputation:

block content
 h1 Hello World!
  p This is a hypothetical paragraph that I would use to write this.
    - var n = 0
    ul
        while n < 4
            li= n++

I think that "p." should be "p". I tested here and it worked.

Upvotes: 1

Related Questions