Skip to content

Partial templates problem #4640

Discussion options

You must be logged in to vote

Templates must be well-formed, meaning here that the tags have to be balanced: you can't have opening tags in one template and the associated closed tags in another. This is because each tempalte is parsed by the browser's HTML parser separately, and the browser will close unclosed tags.

You need to use a single template with a hole in it for the other content. You could use a function to fill the hole:

(content) => html`<div class="container">${content}</div>`

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ivan-suhorukov
Comment options

Answer selected by ivan-suhorukov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants