But that HTML isn't isolated from the page, so it's probably always better to use a <template> instead:
<template id="hello">
<h1>Hello</h1>
</template>
Along with some way of referencing a template's content from an expression.
Expressions
Expressions can use a .value property binding with expressions. The expression is evaluated outside of the <h-var> instance, and the result passed to the value.
Specifying literal types
Literal primitives can use a
type
attribute that looks up a converter:JSON could be supported as child content:
It might be tempting to do HTML this way too:
But that HTML isn't isolated from the page, so it's probably always better to use a
<template>
instead:Along with some way of referencing a template's content from an expression.
Expressions
Expressions can use a
.value
property binding with expressions. The expression is evaluated outside of the<h-var>
instance, and the result passed to the value.