Working on a pugjs mixin. Creating radio buttons in a loop over json. Normal name-value pairs are work as expected. In the loop, setting a radio button to checked by default is fine. Trying to figure out how to not set the checked value for non-selected radio buttons.
I can do this with javascript but seems like I should be able to do this in pug.
Tried setting a variable
-checked =(!fVar.checked)?'checked':''
and then use in tag
input(type='radio' #{checked})
Is there a way to do this in pug?
Figured out one way. Not as direct as I would like but I nested mixins. The main mixin has a case statement that calls child mixins.
Not very D.R.Y. but it works.