From 68f6c87a27bd3616644368154914a683001f8aa6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Nov 2020 15:31:09 +0100 Subject: Various front optimizations --- client/src/main.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'client/src/main.ts') diff --git a/client/src/main.ts b/client/src/main.ts index 2d1749c42..0fddf3aac 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -1,6 +1,6 @@ -import { enableProdMode } from '@angular/core' +import { ApplicationRef, enableProdMode } from '@angular/core' +import { enableDebugTools } from '@angular/platform-browser' import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' - import { AppModule } from './app/app.module' import { environment } from './environments/environment' @@ -27,6 +27,14 @@ const bootstrap = () => platformBrowserDynamic() }) } + if (!environment.production) { + const applicationRef = bootstrapModule.injector.get(ApplicationRef) + const componentRef = applicationRef.components[0] + + // allows to run `ng.profiler.timeChangeDetection();` + enableDebugTools(componentRef) + } + return bootstrapModule }) .catch(err => { -- cgit v1.2.3