import { ApplicationRef , enableProdMode } from '@angular/core' ; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' ; import { AppModule } from './app/app.module' ; import { environment } from './environments/environment' ; import { enableDebugTools } from '@angular/platform-browser' ; if ( environment . production ) { enableProdMode ( ) ; } platformBrowserDynamic ( ) . bootstrapModule ( AppModule ) . then ( ( module ) => { const applicationRef = module . injector . get ( ApplicationRef ) ; const appComponent = applicationRef . components [ 0 ] ; window [ 'appNg' ] = applicationRef ; window [ 'injectorNg' ] = module . injector ; enableDebugTools ( appComponent ) ; } ) ;