(document: string | ComponentType<any> | undefined)
| 88 | /** The document to display, either as a URL to a markdown file or a component to create. */ |
| 89 | @Input() |
| 90 | set document(document: string | ComponentType<any> | undefined) { |
| 91 | if (typeof document === 'string') { |
| 92 | this._fetchDocument(document); |
| 93 | } else if (document) { |
| 94 | this.portal = new ComponentPortal(document); |
| 95 | |
| 96 | // Resolving and creating components dynamically in Angular happens synchronously, but since |
| 97 | // we want to emit the output if the components are actually rendered completely, we wait |
| 98 | // until the Angular zone becomes stable. |
| 99 | // tslint:disable-next-line:no-zone-dependencies |
| 100 | this._ngZone.onStable |
| 101 | .pipe(take(1)) |
| 102 | .subscribe(() => this.contentRendered.next(this._elementRef.nativeElement)); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | @Output() contentRendered = new EventEmitter<HTMLElement>(); |
| 107 |
nothing calls this directly
no test coverage detected