angular/packages/core/src/document.ts
Kristiyan Kostadinov 7ccec1494f feat(core): move DOCUMENT token into core (#60663)
Moves the `DOCUMENT` token from `common` into `core` since it's relevant for lots of SSR use cases and users shouldn't have to install `common` for it. The token is still exported through `common` for backwards compatibility.

PR Close #60663
2025-04-01 12:48:06 +00:00

18 lines
552 B
TypeScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {InjectionToken} from './di';
/**
* A DI Token representing the main rendering context.
* In a browser and SSR this is the DOM Document.
* When using SSR, that document is created by [Domino](https://github.com/angular/domino).
*
* @publicApi
*/
export const DOCUMENT = new InjectionToken<Document>(ngDevMode ? 'DocumentToken' : '');