Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

532 B
Raw Blame
import 'reflect-metadata';
import { Type } from '@angular/core';
import { debugLog } from 'core-app/shared/helpers/debug_output';
import { createCustomElement, NgElementConfig } from '@angular/elements';

export function registerCustomElement(name:string, component:Type<unknown>, config:NgElementConfig) {
  const wrappedElement = createCustomElement(component, config);
  if (customElements.get(name)) {
    debugLog(`${name} custom element already registered.`);
    return;
  }

  customElements.define(name, wrappedElement);
}