File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,14 +127,6 @@ export abstract class ElementComponent<T extends Element> extends NodeComponent<
127127 return this ;
128128 }
129129
130- /**
131- * Set inner HTML
132- */
133- public html ( html : string ) {
134- this . node . innerHTML = html ;
135- return this ;
136- }
137-
138130 /**
139131 * Template literal tag function that accepts HTML code with components in a
140132 * string literal and returns a {@link DocumentComponent}
@@ -152,6 +144,14 @@ export abstract class ElementComponent<T extends Element> extends NodeComponent<
152144 return doc ;
153145 }
154146
147+ /**
148+ * Append HTML
149+ * @example component.html`<div>${component}</div>`
150+ */
151+ public html ( strings : TemplateStringsArray , ...components : NodeComponent < any > [ ] ) : this {
152+ return this . append ( this . tag ( strings , ...components ) ) ;
153+ }
154+
155155 /**
156156 * Set element property
157157 * @param name property name
You can’t perform that action at this time.
0 commit comments