diff --git a/modules/@angular/compiler-cli/integrationtest/test/animate_spec.ts b/modules/@angular/compiler-cli/integrationtest/test/animate_spec.ts index 3e9e30f216..bb0da3636f 100644 --- a/modules/@angular/compiler-cli/integrationtest/test/animate_spec.ts +++ b/modules/@angular/compiler-cli/integrationtest/test/animate_spec.ts @@ -1,4 +1,5 @@ require('reflect-metadata'); +require('@angular/platform-server/src/parse5_adapter.js').Parse5DomAdapter.makeCurrent(); require('zone.js/dist/zone-node.js'); require('zone.js/dist/long-stack-trace-zone.js'); diff --git a/modules/@angular/compiler-cli/integrationtest/test/basic_spec.ts b/modules/@angular/compiler-cli/integrationtest/test/basic_spec.ts index 493cd5ae8b..7ba6a0685c 100644 --- a/modules/@angular/compiler-cli/integrationtest/test/basic_spec.ts +++ b/modules/@angular/compiler-cli/integrationtest/test/basic_spec.ts @@ -2,6 +2,7 @@ // TODO(alexeagle): maybe remove that check? require('reflect-metadata'); +require('@angular/platform-server/src/parse5_adapter.js').Parse5DomAdapter.makeCurrent(); require('zone.js/dist/zone-node.js'); require('zone.js/dist/long-stack-trace-zone.js'); diff --git a/modules/@angular/compiler-cli/integrationtest/test/i18n_spec.ts b/modules/@angular/compiler-cli/integrationtest/test/i18n_spec.ts index 858f6ad04c..26118bc662 100644 --- a/modules/@angular/compiler-cli/integrationtest/test/i18n_spec.ts +++ b/modules/@angular/compiler-cli/integrationtest/test/i18n_spec.ts @@ -1,6 +1,8 @@ // Only needed to satisfy the check in core/src/util/decorators.ts // TODO(alexeagle): maybe remove that check? require('reflect-metadata'); + +require('@angular/platform-server/src/parse5_adapter.js').Parse5DomAdapter.makeCurrent(); require('zone.js/dist/zone-node.js'); require('zone.js/dist/long-stack-trace-zone.js'); let serializer = require('@angular/compiler/src/i18n/xmb_serializer.js'); diff --git a/modules/@angular/compiler-cli/src/codegen.ts b/modules/@angular/compiler-cli/src/codegen.ts index 9030bb580d..0248e1daa7 100644 --- a/modules/@angular/compiler-cli/src/codegen.ts +++ b/modules/@angular/compiler-cli/src/codegen.ts @@ -4,6 +4,7 @@ */ import * as compiler from '@angular/compiler'; import {ViewEncapsulation} from '@angular/core'; +import {Parse5DomAdapter} from '@angular/platform-server'; import {AngularCompilerOptions} from '@angular/tsc-wrapped'; import * as path from 'path'; import * as ts from 'typescript'; @@ -105,6 +106,8 @@ export class CodeGenerator { } codegen(): Promise { + Parse5DomAdapter.makeCurrent(); + let stylesheetPromises: Promise[] = []; const generateOneFile = (absSourcePath: string) => Promise.all(this.readComponents(absSourcePath)) diff --git a/modules/@angular/compiler-cli/src/extract_i18n.ts b/modules/@angular/compiler-cli/src/extract_i18n.ts index cde822c1e1..f84be2d29b 100644 --- a/modules/@angular/compiler-cli/src/extract_i18n.ts +++ b/modules/@angular/compiler-cli/src/extract_i18n.ts @@ -16,6 +16,8 @@ import {ViewEncapsulation} from '@angular/core'; import {StaticReflector} from './static_reflector'; import {CompileMetadataResolver, HtmlParser, DirectiveNormalizer, Lexer, Parser, TemplateParser, DomElementSchemaRegistry, StyleCompiler, ViewCompiler, TypeScriptEmitter, MessageExtractor, removeDuplicates, ExtractionResult, Message, ParseError, serializeXmb,} from './compiler_private'; +import {Parse5DomAdapter} from '@angular/platform-server'; + import {ReflectorHost} from './reflector_host'; import {StaticAndDynamicReflectionCapabilities} from './static_reflection_capabilities'; @@ -95,6 +97,7 @@ class Extractor { } extract(): Promise { + Parse5DomAdapter.makeCurrent(); _dirPaths.clear(); const promises = this._program.getSourceFiles()