docs: enable debug tools with current versions of Angular (#25361)

Updating code snippet in docs that shows how to enable debug tools.
PR Close #25361
This commit is contained in:
Jonas Bandi 2018-08-07 21:56:35 +02:00 committed by Ben Lesh
parent b5f354f2fb
commit eeb81b9370
1 changed files with 9 additions and 3 deletions

View File

@ -14,11 +14,17 @@ Ctrl + Shift + j.
By default the debug tools are disabled. You can enable debug tools as follows: By default the debug tools are disabled. You can enable debug tools as follows:
```typescript ```typescript
import {ApplicationRef} from '@angular/core';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {enableDebugTools} from '@angular/platform-browser'; import {enableDebugTools} from '@angular/platform-browser';
bootstrap(Application).then((appRef) => {
enableDebugTools(appRef); platformBrowserDynamic().bootstrapModule(AppModule)
}); .then(moduleRef => {
const applicationRef = moduleRef.injector.get(ApplicationRef);
const appComponent = applicationRef.components[0];
enableDebugTools(appComponent);
})
``` ```
### Using debug tools ### Using debug tools