import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' ; import { AppModule } from './app/app.module' ; const platformRef = platformBrowserDynamic ( ) ; if ( ! customElements . get ( 'web-app-angular' ) ) customElements . define ( 'web-app-angular' , class extends HTMLElement { protected mount ; public connectedCallback ( ) { this . mount = document . createElement ( 'app-root' ) ; this . appendChild ( this . mount ) ; platformRef . bootstrapModule ( AppModule ) . catch ( err => console . error ( err ) ) ; } public disconnectedCallback ( ) { this . innerHTML = '' ; } } ) ;