The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Web Component Examples - Include A Template Inline

TODO: Pull subtitle into page object

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Web Component Examples - Include A Template Inline

Not sure if this is a good idea or not, but the
goal is to have not have to put the `template``
on the page, just the call the to component

-- script
-- type: show
-- title: JavaScript

customElements.define(
  "my-widget",
  class extends HTMLElement {
    constructor() {
      super();
      let template = document.createElement("template");
      template.innerHTML = `<p>This is a new template</p>`
      let templateContent = template.content;
      const shadowRoot = this.attachShadow({ mode: "open" });
      shadowRoot.appendChild(templateContent.cloneNode(true));
    }
  },
);

-- html
-- title: Output
-- type: showabove
-- showtitle: HTML


<my-widget></my-widget>


-- categories
-- HTML 
-- Web Components 

-- groups
-- Web Component Snippets

-- metadata
-- date: 2023-10-30 15:57:00
-- id: 2xuu8csa
-- site: aws
-- type: draft 
-- status: published