Skip to content

Instantly share code, notes, and snippets.

@dimaxweb
Last active December 18, 2019 07:09
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 dimaxweb/f790e22bc4ace595b0ead183d06ed6db to your computer and use it in GitHub Desktop.
Save dimaxweb/f790e22bc4ace595b0ead183d06ed6db to your computer and use it in GitHub Desktop.
Enable debugTools Angular8
import {ApplicationRef} from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import {enableDebugTools} from '@angular/platform-browser';
platformBrowserDynamic().bootstrapModule(AppModule).then(moduleRef => {
const applicationRef = moduleRef.injector.get(ApplicationRef);
const componentRef = applicationRef.components[0];
// allows to run `ng.profiler.timeChangeDetection();`
enableDebugTools(componentRef);
}).catch(err => window['console'].error(err));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment