From b2cf379d1cfa8be06c12a6f148c1399279218ea5 Mon Sep 17 00:00:00 2001 From: danielcrisp Date: Thu, 3 Nov 2016 04:55:49 +0000 Subject: [PATCH] fix(enableDebugTools): create AngularTools by merging into context.ng (#12003) When using `enableDebugTools` the tools are merged into `context.ng` to prevent `ng.probe` and `ng.coreTokens` from being clobbered. Fixes #12002 --- modules/@angular/platform-browser/src/browser/tools/tools.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/@angular/platform-browser/src/browser/tools/tools.ts b/modules/@angular/platform-browser/src/browser/tools/tools.ts index 6424efb321..dab17b8ec6 100644 --- a/modules/@angular/platform-browser/src/browser/tools/tools.ts +++ b/modules/@angular/platform-browser/src/browser/tools/tools.ts @@ -27,7 +27,7 @@ var context = global; * @experimental All debugging apis are currently experimental. */ export function enableDebugTools(ref: ComponentRef): ComponentRef { - context.ng = new AngularTools(ref); + (Object).assign(context.ng, new AngularTools(ref)); return ref; } @@ -37,5 +37,5 @@ export function enableDebugTools(ref: ComponentRef): ComponentRef { * @experimental All debugging apis are currently experimental. */ export function disableDebugTools(): void { - delete context.ng; + delete context.ng.profiler; }