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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -