mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Formats the entire devtools directory with the ng-dev formatting tool. Previously we relied on prettier, so this commit also remove prettier from devtools' dependencies.
24 lines
821 B
TypeScript
24 lines
821 B
TypeScript
import {Component, ElementRef, ViewChild} from '@angular/core';
|
|
import {Events, MessageBus, PriorityAwareMessageBus} from 'protocol';
|
|
|
|
import {IFrameMessageBus} from '../../iframe-message-bus';
|
|
|
|
@Component({
|
|
templateUrl: './devtools-app.component.html',
|
|
styleUrls: ['./devtools-app.component.scss'],
|
|
providers: [
|
|
{
|
|
provide: MessageBus,
|
|
useFactory(): MessageBus<Events> {
|
|
return new PriorityAwareMessageBus(new IFrameMessageBus(
|
|
'angular-devtools', 'angular-devtools-backend',
|
|
// tslint:disable-next-line: no-non-null-assertion
|
|
() => (document.querySelector('#sample-app') as HTMLIFrameElement).contentWindow!));
|
|
},
|
|
},
|
|
],
|
|
})
|
|
export class DevToolsComponent {
|
|
messageBus: IFrameMessageBus|null = null;
|
|
@ViewChild('ref') iframe: ElementRef;
|
|
}
|