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:
parent
e25baa08b3
commit
b2cf379d1c
|
@ -27,7 +27,7 @@ var context = <any>global;
|
||||||
* @experimental All debugging apis are currently experimental.
|
* @experimental All debugging apis are currently experimental.
|
||||||
*/
|
*/
|
||||||
export function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T> {
|
export function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T> {
|
||||||
context.ng = new AngularTools(ref);
|
(<any>Object).assign(context.ng, new AngularTools(ref));
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,5 +37,5 @@ export function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T> {
|
||||||
* @experimental All debugging apis are currently experimental.
|
* @experimental All debugging apis are currently experimental.
|
||||||
*/
|
*/
|
||||||
export function disableDebugTools(): void {
|
export function disableDebugTools(): void {
|
||||||
delete context.ng;
|
delete context.ng.profiler;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue