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