()
| 44 | * For example to create the renderer or to do sanitization. |
| 45 | */ |
| 46 | export 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…