forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtools.ts
More file actions
27 lines (24 loc) · 771 Bytes
/
tools.ts
File metadata and controls
27 lines (24 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import {global} from 'angular2/src/core/facade/lang';
import {ComponentRef} from 'angular2/src/core/linker/dynamic_component_loader';
import {AngularTools} from './common_tools';
var context = <any>global;
/**
* Enabled Angular 2 debug tools that are accessible via your browser's
* developer console.
*
* Usage:
*
* 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
* 1. Type `ng.` (usually the console will show auto-complete suggestion)
* 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
* then hit Enter.
*/
export function enableDebugTools(ref: ComponentRef): void {
context.ng = new AngularTools(ref);
}
/**
* Disables Angular 2 tools.
*/
export function disableDebugTools(): void {
context.ng = undefined;
}