Skip to content

Instantly share code, notes, and snippets.

@daniele-zurico
Created June 10, 2018 16:16
Show Gist options
  • Select an option

  • Save daniele-zurico/a604988502b5f52475fe6a80c93b2e35 to your computer and use it in GitHub Desktop.

Select an option

Save daniele-zurico/a604988502b5f52475fe6a80c93b2e35 to your computer and use it in GitHub Desktop.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, Injector } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {
MatTableModule,
MatPaginatorModule,
MatSortModule,
} from '@angular/material';
import { createCustomElement } from '@angular/elements';
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
MatTableModule,
MatPaginatorModule,
MatSortModule,
],
providers: [],
bootstrap: [],
entryComponents: [AppComponent],
})
export class AppModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const elm = createCustomElement(AppComponent, { injector: this.injector });
customElements.define('ngx-data-table', elm);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment