From 6e842fc5bf0c3cb06c964400b6cf1bf3db01e18e Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 11 Aug 2016 15:04:00 -0700 Subject: [PATCH] feat(ngc): allow ngc implementations to provide XHR (#10708) --- modules/@angular/compiler-cli/src/codegen.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/@angular/compiler-cli/src/codegen.ts b/modules/@angular/compiler-cli/src/codegen.ts index be828aa609..8c468fb830 100644 --- a/modules/@angular/compiler-cli/src/codegen.ts +++ b/modules/@angular/compiler-cli/src/codegen.ts @@ -118,8 +118,8 @@ export class CodeGenerator { static create( options: AngularCompilerOptions, program: ts.Program, compilerHost: ts.CompilerHost, - reflectorHostContext?: ReflectorHostContext): CodeGenerator { - const xhr: compiler.XHR = { + reflectorHostContext?: ReflectorHostContext, xhr?: compiler.XHR): CodeGenerator { + xhr = xhr || { get: (s: string) => { if (!compilerHost.fileExists(s)) { // TODO: We should really have a test for error cases like this!