Created
March 11, 2019 01:27
-
-
Save phenomnomnominal/1aa75f8260dce51c267259041d336dfc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class RouterConfigLoader { | |
// ... | |
private loadModuleFactory(loadChildren: LoadChildren): Observable<NgModuleFactory<any>> { | |
if (typeof loadChildren === 'string') { | |
// ... | |
} else { | |
return wrapIntoObservable(loadChildren()).pipe(mergeMap((t: any) => { | |
if (t instanceof NgModuleFactory) { | |
return of (t); | |
} else { | |
return from(this.compiler.compileModuleAsync(t)); | |
} | |
})); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment