I am trying to add a dynamic class to a jade pattern. For instance:
- var obj = {a: 1, b: 2, c: 3}; - var len = Object.keys(obj).length; .abc-#{len}
But the compiler makes an exception:
> 4| .abc-#{len} ------------^ Unexpected token `interpolation` expected `text`, `interpolated-code`, `code`, `:`, `slash`, `newline` or `eos`
I tried everything I could think of. Cleaned up https://pugjs.org/language/interpolation.html . Can really use a hand.
Thanks.
source share