MCPcopy Create free account
hub / github.com/angular/components / document

Method document

docs/src/app/shared/doc-viewer/doc-viewer.ts:90–104  ·  view source on GitHub ↗
(document: string | ComponentType<any> | undefined)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

_fetchDocumentMethod · 0.95
nextMethod · 0.45

Tested by

no test coverage detected