The current component instance.
The DOM element to receive the attributes and children.
The ComponentParams object containing attributes and childNodes.
class Card extends TComponent<HTMLDivElement> {
static template = `<div class="card"><div id="body"></div></div>`;
constructor(params: ComponentParams) {
super(params);
// Inject props and slots into the internal body element
applyParams(this, this.getById('body', HTMLDivElement), params);
}
}
Applies component parameters (attributes and child nodes) to a specific target DOM element. This utility drastically simplifies routing "Props" (attributes) and "Slots" (childNodes) to either the component's root element or a specific internal element.
It smartly handles merging of
classandstyleattributes, bindings of events, and safely ignores internal attributes likeid.