From 915a6666f89d06873d4db17538a10f1fd1416fde Mon Sep 17 00:00:00 2001 From: vsavkin Date: Thu, 28 Jul 2016 12:14:27 -0700 Subject: [PATCH] fix(core): fix offline detection in ng_module_factory_loader --- .../core/src/linker/system_js_ng_module_factory_loader.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/@angular/core/src/linker/system_js_ng_module_factory_loader.ts b/modules/@angular/core/src/linker/system_js_ng_module_factory_loader.ts index 28232be4cf..0316a24ed0 100644 --- a/modules/@angular/core/src/linker/system_js_ng_module_factory_loader.ts +++ b/modules/@angular/core/src/linker/system_js_ng_module_factory_loader.ts @@ -25,10 +25,11 @@ const FACTORY_CLASS_SUFFIX = 'NgFactory'; */ @Injectable() export class SystemJsNgModuleLoader implements NgModuleFactoryLoader { - constructor(@Optional() private _compiler: Compiler) {} + constructor(private _compiler: Compiler) {} load(path: string): Promise> { - return this._compiler ? this.loadAndCompile(path) : this.loadFactory(path); + const offlineMode = this._compiler instanceof Compiler; + return offlineMode ? this.loadFactory(path) : this.loadAndCompile(path); } private loadAndCompile(path: string): Promise> {