div = document.createElement('div');
div.innerHTML = "<custom-element/>";
element = div.querySelector(":first-child");
element.update(); // how do I call the update method on my custom element?
div.appendChild(document.createElement('custom-element'));
element = div.querySelector(':first-child');
element.update();
div.innerHTML = '<custom-element></custom-element>';
// trigger polyfill upgrade directly
element = CustomElements.upgrade(div.querySelector(':first-child'));
element.update();
// or put the div in the document and let the element upgrade automatically
document.body.appendChild(div);
// wait for Custom Elements polyfill to run (using a Mutation Observer);
requestAnimationFrame(element.update);
// or put the div in the document and force the element to upgrade synchronusly.
CustomElements.takeRecords();
element.update();
ShadowDOMPolyfill.wrap($0)
// Polymer exposes this as window.wrap