Closed goto-bus-stop closed 5 years ago
Comment state is preserved when entering a template ${embed} part, so you can do things like
${embed}
html` <div> <!-- ${someElementThatIWantHidden()} --> ${someElementThatIWantShown()} </div> `
instead of the somewhat clumsy
html` <div> ${''/* someElementThatIWantHidden() */} </div> `
Of course, in the first situation, someElementThatIWantHidden() is still evaluated, just not inserted.
With opts.comments = true, the embedded parts are stringified and concatenated.
opts.comments = true
Comment state is preserved when entering a template
${embed}
part, so you can do things likeinstead of the somewhat clumsy
Of course, in the first situation, someElementThatIWantHidden() is still evaluated, just not inserted.
With
opts.comments = true
, the embedded parts are stringified and concatenated.