This is the archived documentation for Angular v5. Please visit angular.io to see documentation for the current version of Angular.

DOCUMENT

npm Package @angular/platform-browser
Module import { DOCUMENT } from '@angular/platform-browser';
Source platform-browser/src/dom/dom_tokens.ts

Deprecation Notes

import from @angular/common instead.

      
      const DOCUMENT: any;
    

Description

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).