fix(core): fix offline detection in ng_module_factory_loader
This commit is contained in:
parent
72da547d6a
commit
915a6666f8
@ -25,10 +25,11 @@ const FACTORY_CLASS_SUFFIX = 'NgFactory';
|
|||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SystemJsNgModuleLoader implements NgModuleFactoryLoader {
|
export class SystemJsNgModuleLoader implements NgModuleFactoryLoader {
|
||||||
constructor(@Optional() private _compiler: Compiler) {}
|
constructor(private _compiler: Compiler) {}
|
||||||
|
|
||||||
load(path: string): Promise<NgModuleFactory<any>> {
|
load(path: string): Promise<NgModuleFactory<any>> {
|
||||||
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<NgModuleFactory<any>> {
|
private loadAndCompile(path: string): Promise<NgModuleFactory<any>> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user