@pnp/generator-spfx
Version:
This Yeoman generator helps organisations to improve their development workflow with the SharePoint Framework. It extends the functionalities of the @microsoft/generator-sharepoint based on best pattern and practices. This generator extends the capabiliti
25 lines (21 loc) • 763 B
text/typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, Injector } from '@angular/core';
import { createCustomElement } from '@angular/elements';
import { <%= componentClassName %>Component } from './<%= componentClassNameKebabCase %>/<%= componentClassNameKebabCase %>.component';
({
declarations: [
<%= componentClassName %>Component
],
imports: [
BrowserModule
],
providers: [],
entryComponents: [<%= componentClassName %>Component]
})
export class AppModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const el = createCustomElement(<%= componentClassName %>Component, { injector: this.injector });
customElements.define('app-<%= componentClassNameKebabCase %>', el);
}
}