I'm slightly puzzled, and no doubt I'm doing something silly here, but I have created my own element "my-element" which has an additional function "foo()". When I place one of these guys declaratively on my page, it works fine, eg:
<my-element></my-element>
This element is an instance of MyElement and it has the function foo().
However, if I place it (declaratively) inside a template, which I then later clone in to my document, then the element does not appear to be upgraded and does not have my foo() function. eg:
in html:
<template id="t">
<my-element></my-element>
</template>
in javascript:
var t = document.getElementById('t');
document.body.appendChild(t.content.cloneNode(true));
The element does end up in my DOM, but it just doesn't have the foo() function nor is it an actual instanceof MyElement.
Am I missing something obvious here?
/Cheers,
Jelte