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

Function getDocument

packages/core/src/render3/interfaces/document.ts:46–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 * For example to create the renderer or to do sanitization.
45 */
46export function getDocument(): Document {
47 if (DOCUMENT !== undefined) {
48 return DOCUMENT;
49 } else if (typeof document !== 'undefined') {
50 return document;
51 }
52
53 throw new RuntimeError(
54 RuntimeErrorCode.MISSING_DOCUMENT,
55 (typeof ngDevMode === 'undefined' || ngDevMode) &&
56 `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`,
57 );
58
59 // No "document" can be found. This should only happen if we are running ivy outside Angular and
60 // the current platform is not a browser. Since this is not a supported scenario at the moment
61 // this should not happen in Angular apps.
62 // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
63 // public API.
64}

Callers 8

startMethod · 0.90
scanImagesMethod · 0.90
ɵɵsanitizeHtmlFunction · 0.90
createComponentRefMethod · 0.90
parseIcuCaseFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…