Is there a way to make the shadow dom's <slot>
element work in firefox?
As a work around i'm currently adding all my content from an object with a for loop
and .innerHTML
(see below) but this is a rather ugly method.
webcomponents.js is added as first script tag in the head
html
<portfolio-container></portfolio-container>
js
const allContent = [{
title: "hello",
}, {
title: "hello",
}];
for (var i = 0; i < allContent.length; i++) {
shadowRoot.innerHTML += "<portfolio-item data-title='"+ allContent[i].title +"'></port-item>";
}