pug - Correct usage of setting a variable (i of for loop) as a class selector in Jade -


I am trying to create a list with each item respectively whose class is related to its respective order

  & lt; ol & gt; & Lt; Li class = "1" & gt; 1 & lt; / li & gt; & Lt; Li class = "2" & gt; 2 & lt; / li & gt; & Lt; Li class = "3" & gt; 3 & lt; / li & gt; ... & lt; / ol & gt;   

using the loop in Z

  ol - for (var i = 1; i & lt ; = 8; i ++) {li (class = '! {I}')! {I} -}   

Although this is not working

What needs to be improved here?

string projection syntax is # {variable} , not ! {Variable} :

  li (class = '# {i}')! {I} // or just li (class = i)! {I}   

Also, when you vs # ii for li For content, HTML institutions in the past will be saved while not later.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -