1

I'm novice in Jade and I have an issue with adding attributes that depend on json data. Please see the code below:

- var promoCode = data.promoCode - var instalments = data.instalments div(class= promoCode === true ? "product__img-wrap_promo-code" : "")(class= instalments === true ? "product__img-wrap_instalments" : "")

Now, it works fine for me, but I have a notification on the console like this:

C:\mobileGit\mobile_frontend\www\markup\modules\product_new\product_new.jade, line 11: You should not have jade tags with multiple attributes.

Maybe someone knows how to fix this trouble.

1 Answer 1

1

Tested with : http://jade-lang.com/demo/

- var promoCode = true
- var instalments = true

div(class=promoCode === true ? "product__img-wrap_promo-code" : "", class= instalments === true ? "product__img-wrap_instalments" : "")

HTML Output :

<div class="product__img-wrap_promo-code product__img-wrap_instalments"></div>

Not the answer you're looking for? Browse other questions tagged or ask your own question.