I'm trying to convert the js:
// var XComponent = document.registerElement('x-component', {
// prototype: Object.create(HTMLElement.prototype, {
// createdCallback: {
// value: function() {
// var root = this.createShadowRoot();
// var template = document.querySelector('#template');
// var clone = document.importNode(template.content, true);
// root.appendChild(clone);
// }
// }
// })
// });
into the scalajs:
import org.scalajs.dom.document
object XComponent {
implicit class ExtendedDom(x: html.Document) {
def registerElement( name:String, obj: js.Object ): Unit = js.native
}
}
class XComponent {
import XComponent._
val xComponent = document.registerElement("x-component", js.Object {
..
})
}
Not sure what to do about prototype property..?