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:
parent
b5f354f2fb
commit
eeb81b9370
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue