Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
194
rated 0 times [  199] [ 5]  / answers: 1 / hits: 55162  / 12 Years ago, thu, january 3, 2013, 12:00:00

Is there a way to do this inline in a jade template?



if(typeof fromEdit != 'undefined')
div#demo.collapse.in
else
div#demo.collapse


Would like to do this conditional check inline and the result would add the .in to the end of the div if fromEdit exists.


More From » node.js

 Answers
12

This works:



div#demo.collapse(class=typeof fromEdit === undefined ?  : in)


Try it out here.


[#81101] Wednesday, January 2, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
haylie

Total Points: 26
Total Questions: 108
Total Answers: 104

Location: France
Member since Thu, Oct 27, 2022
2 Years ago
;