diff --git a/packages/common/src/common.ts b/packages/common/src/common.ts index 21889ba297..0c3e04abde 100644 --- a/packages/common/src/common.ts +++ b/packages/common/src/common.ts @@ -15,6 +15,7 @@ export * from './location/index'; export {NgLocaleLocalization, NgLocalization} from './localization'; export {CommonModule} from './common_module'; export {NgClass, NgFor, NgForOf, NgForOfContext, NgIf, NgIfContext, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NgComponentOutlet} from './directives/index'; +export {DOCUMENT} from './dom_tokens'; export {AsyncPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, JsonPipe, LowerCasePipe, CurrencyPipe, DecimalPipe, PercentPipe, SlicePipe, UpperCasePipe, TitleCasePipe} from './pipes/index'; export {PLATFORM_BROWSER_ID as ɵPLATFORM_BROWSER_ID, PLATFORM_SERVER_ID as ɵPLATFORM_SERVER_ID, PLATFORM_WORKER_APP_ID as ɵPLATFORM_WORKER_APP_ID, PLATFORM_WORKER_UI_ID as ɵPLATFORM_WORKER_UI_ID, isPlatformBrowser, isPlatformServer, isPlatformWorkerApp, isPlatformWorkerUi} from './platform_id'; export {VERSION} from './version'; diff --git a/packages/common/src/dom_tokens.ts b/packages/common/src/dom_tokens.ts new file mode 100644 index 0000000000..c31db4436f --- /dev/null +++ b/packages/common/src/dom_tokens.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. 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.io/license + */ + +import {InjectionToken} from '@angular/core'; + +/** + * A DI Token representing the main rendering context. In a browser this is the DOM Document. + * + * Note: Document might not be available in the Application Context when Application and Rendering + * Contexts are not the same (e.g. when running the application into a Web Worker). + * + * @stable + */ +export const DOCUMENT = new InjectionToken('DocumentToken'); diff --git a/packages/platform-browser/src/dom/dom_tokens.ts b/packages/platform-browser/src/dom/dom_tokens.ts index c31db4436f..6ceef650cd 100644 --- a/packages/platform-browser/src/dom/dom_tokens.ts +++ b/packages/platform-browser/src/dom/dom_tokens.ts @@ -8,12 +8,14 @@ import {InjectionToken} from '@angular/core'; +import {DOCUMENT as commonDOCUMENT} from '@angular/common'; + /** * A DI Token representing the main rendering context. In a browser this is the DOM Document. * * Note: Document might not be available in the Application Context when Application and Rendering * Contexts are not the same (e.g. when running the application into a Web Worker). * - * @stable + * @deprecated, import from `@angular/common` instead. */ -export const DOCUMENT = new InjectionToken('DocumentToken'); +export const DOCUMENT = commonDOCUMENT;