2020-01-27 18:40:18 +00:00
|
|
|
import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core';
|
|
|
|
|
import { IFrameMessageBus } from 'src/iframe-message-bus';
|
|
|
|
|
|
|
|
|
|
@Component({
|
2020-02-13 17:03:22 +00:00
|
|
|
templateUrl: './devtools-app.component.html',
|
|
|
|
|
styleUrls: ['./devtools-app.component.css'],
|
2020-01-27 18:40:18 +00:00
|
|
|
})
|
|
|
|
|
export class DevToolsComponent implements AfterViewInit {
|
|
|
|
|
messageBus: IFrameMessageBus | null = null;
|
|
|
|
|
@ViewChild('ref') iframe: ElementRef;
|
|
|
|
|
|
|
|
|
|
ngAfterViewInit() {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.messageBus = new IFrameMessageBus(
|
|
|
|
|
'angular-devtools',
|
|
|
|
|
'angular-devtools-backend',
|
|
|
|
|
(document.querySelector('#sample-app') as HTMLIFrameElement).contentWindow
|
|
|
|
|
) as any;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|