Skip to content

Commit

Permalink
fix(enableDebugTools): create AngularTools by merging into context.ng (
Browse files Browse the repository at this point in the history
…angular#12003)

When using `enableDebugTools` the tools are merged into `context.ng` to prevent `ng.probe` and `ng.coreTokens` from being clobbered.

Fixes angular#12002
  • Loading branch information
danielcrisp authored and vikerman committed Nov 3, 2016
1 parent e25baa0 commit b2cf379
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/@angular/platform-browser/src/browser/tools/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

0 comments on commit b2cf379

Please sign in to comment.