Skip to content

Instantly share code, notes, and snippets.

@pbochynski
Last active November 8, 2024 13:51
Show Gist options
  • Save pbochynski/79fe7f07b404cecad750d4d7415f3fda to your computer and use it in GitHub Desktop.
Save pbochynski/79fe7f07b404cecad750d4d7415f3fda to your computer and use it in GitHub Desktop.
Service Manager plugin
class MyComponent1 extends HTMLElement {
connectedCallback() {
this.innerHTML = ''
// create elements programmatically
const button = document.createElement('ui5-button');
button.textContent = 'Button 2';
this.appendChild(button);
button.addEventListener('click', () => {
alert('Button 2 clicked');
})
}
}
if (!customElements.get('my-component-1')) {
customElements.define('my-component-1', MyComponent1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment