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
This commit is contained in:
danielcrisp 2016-11-03 04:55:49 +00:00 committed by vikerman
parent e25baa08b3
commit b2cf379d1c
1 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ var context = <any>global;
* @experimental All debugging apis are currently experimental.
*/
export function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T> {
context.ng = new AngularTools(ref);
(<any>Object).assign(context.ng, new AngularTools(ref));
return ref;
}
@ -37,5 +37,5 @@ export function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T> {
* @experimental All debugging apis are currently experimental.
*/
export function disableDebugTools(): void {
delete context.ng;
delete context.ng.profiler;
}