enableDebugTools function

void enableDebugTools (ComponentRef<Object> ref)

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)
  2. Type ng. (usually the console will show auto-complete suggestion)
  3. Try the change detection profiler ng.profiler.timeChangeDetection() then hit Enter.

Implementation

void enableDebugTools(ComponentRef<Object> ref) {
  final tools = AngularTools(ref);
  context['ng'] = JsObject.jsify({
    'profiler': {
      'timeChangeDetection': ([config]) {
        tools.profiler.timeChangeDetection(config);
      }
    }
  });
}