I have this jade template that has some logic inside it, but i don't know what im doing wrong here, the code is:
#container
-for(var col=0; col < 2 ;col++){
- if(col % 4 == 0){
.movie_row
- }
.movie_thumb
- }
I want the results to be like:
<div id="container">
<div class="movie_row">
<div class="movie_thumb"></div>
</div>
<div class="movie_row">
<div class="movie_thumb"></div>
</div>
</div>
but its giving me this:
<div id="container"></div>
<div class="movie_row"></div>
<div class="movie_thumb"></div>
<div class="movie_row"></div>
<div class="movie_thumb"></div>
Am I doing the conditions wrong? I looked at the docs, there's nothing which looks like nested conditionals.
Try this:
#container
-for(var col=0; col<2; col++)
-if(col%4 == 0)
.movie_row
.movie_thumb
Not really sure why you're using % 4
in your code, but something like:
#container
-for(var col=0; col < 2 ;col++) {
.movie_row
.movie_thumb
- }
does the trick