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.
(This would be a comment if I could add one.)
If you don't want the class attribute to be added when there is no value, you can assign it undefined instead of an empty string. Here is the previous example, slightly modified:
div#demo.collapse(class=typeof fromEdit === "undefined" ? undefined : "in")