Added a new ability to specify a slot for child elements of a IgniteElement to be placed in. Next up is a reconstruct method, which may or may not be possible, not sure.

This commit is contained in:
2020-07-28 22:46:22 -07:00
parent 43962757f0
commit 374defdc82
4 changed files with 41 additions and 4 deletions

View File

@ -7,6 +7,7 @@ class IgniteElement extends HTMLElement {
this.onDisconnected = null;
this.template = null;
this.elements = [];
this.createProperties();
}
@ -50,6 +51,9 @@ class IgniteElement extends HTMLElement {
this.template.element = this;
this.template.tagName = this.tagName;
//Add any childNodes we have to the elements list within this
this.childNodes.forEach((item) => this.elements.push(item));
//Make sure the render template is our template, if not, add it as a child.
var renderTemplate = this.render();
if (renderTemplate !== this.template && renderTemplate) {