I have a custom component defined in vanilla JS:
class Article extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this.render();
}
render() {
this.innerHTML = /*html*/ `
<div>this.getAttribute("title")</div>
`;
}
}
customElements.define("custom-article", Article);
I then would like to instantiate these components from an array, specifically (in the HTML):
This is trivial to do in both Angular and Vue.js (and probably in every other JS framework), however I can't find documentation on the same functionality being implemented in Vanilla JS.