Skip to content

Instantly share code, notes, and snippets.

@lydemann
Last active June 16, 2020 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lydemann/1dfe3a2a152ff697c7c2f856b1e8fd48 to your computer and use it in GitHub Desktop.
Save lydemann/1dfe3a2a152ff697c7c2f856b1e8fd48 to your computer and use it in GitHub Desktop.
shared-ui-elements.module.ts
@NgModule({
imports: [BrowserModule, ...IMPORTS, TranslateModule.forRoot()],
declarations: [],
exports: [...IMPORTS],
})
export class SharedUiElementsModule {
constructor(private injector: Injector) {}
public ngDoBootstrap() {
const elements: Array<[Type<any>, string]> = [
// UI lib components go here
[CrudItemComponent, 'app-crud-item'],
];
for (const [component, name] of elements) {
const el = createCustomElement(component, { injector: this.injector });
customElements.define(name, el);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment