Skip to content

Instantly share code, notes, and snippets.

@phenomnomnominal
Created March 11, 2019 01:27
Show Gist options
  • Save phenomnomnominal/1aa75f8260dce51c267259041d336dfc to your computer and use it in GitHub Desktop.
Save phenomnomnominal/1aa75f8260dce51c267259041d336dfc to your computer and use it in GitHub Desktop.
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