MCPcopy Index your code
hub / github.com/angular/angular / _document

Function _document

packages/platform-server/src/server.ts:95–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93export class ServerModule {}
94
95function _document() {
96 const injector = inject(Injector);
97 const config: PlatformConfig | null = injector.get(INITIAL_CONFIG, null);
98 const _enableDomEmulation = enableDomEmulation(injector);
99 let document: Document;
100 if (config && config.document) {
101 document =
102 typeof config.document === 'string'
103 ? _enableDomEmulation
104 ? parseDocument(
105 config.document,
106 config.url !== undefined
107 ? resolveUrl(config.url, 'http://localhost').href
108 : undefined,
109 )
110 : window.document
111 : config.document;
112 } else {
113 document = getDOM().createHtmlDocument();
114 }
115 // Tell ivy about the global document
116 ɵsetDocument(document);
117 return document;
118}
119
120/**
121 * Creates a server-side instance of an Angular platform.

Callers

nothing calls this directly

Calls 7

injectFunction · 0.90
enableDomEmulationFunction · 0.90
parseDocumentFunction · 0.90
resolveUrlFunction · 0.90
getDOMFunction · 0.85
getMethod · 0.65
createHtmlDocumentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…