4

What I want to achieve is as follows in jade4j -

mixin mixin_a()
  p This is mixin A

mixin mixin_b(mixin_reference)
  p This is mixin B
    +mixin_reference()

+mixin_b(mixin_a)

Here I am passing mixin_a as a reference in mixin_b and expecting that as a parameter.

But, when I try to do +mixin_reference() it says - mixin_reference is not defined.

Question: 1. What wrong I am doing in calling the mixin_reference? 2. What should be the best to achieve the same functionality? (reason is this, because I am expecting passed parameter mixin name in mixin_b as dynamic value.

abhnv
  • 41
  • 1
  • 3

1 Answers1

0

Since Jade v1.0.0 this is possible:

mixin mixin_a
  p Yeah, mixin A!

mixin mixin_b(mixMeIn)
  p Yeah, mixin B!
  +#{mixMeIn}  

+mixin_b('mixin_a')
  • It works for jade (for js) but doesn't work for jade4j (jade for Java), which was the actual question... – abhnv Feb 15 '16 at 04:45