Skip to content

Commit

Permalink
fix(router): support NgFactory promise in loadChildren typings (#29392)
Browse files Browse the repository at this point in the history
The router loadChildren property already supports a promise that returns a NgModuleFactory, but the typings cause the compilation to fail.

PR Close #29392
  • Loading branch information
filipesilva authored and mhevery committed Mar 25, 2019
1 parent 4122528 commit 26a8c59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/router/src/config.ts
Expand Up @@ -97,8 +97,8 @@ export type ResolveData = {
* @see `Route#loadChildren`.
* @publicApi
*/
export type LoadChildrenCallback = () =>
Type<any>| NgModuleFactory<any>| Promise<Type<any>>| Observable<Type<any>>;
export type LoadChildrenCallback = () => Type<any>| NgModuleFactory<any>|
Promise<NgModuleFactory<any>>| Promise<Type<any>>| Observable<Type<any>>;

/**
*
Expand Down
2 changes: 1 addition & 1 deletion tools/public_api_guard/router/router.d.ts
Expand Up @@ -147,7 +147,7 @@ export declare class GuardsCheckStart extends RouterEvent {

export declare type LoadChildren = string | LoadChildrenCallback;

export declare type LoadChildrenCallback = () => Type<any> | NgModuleFactory<any> | Promise<Type<any>> | Observable<Type<any>>;
export declare type LoadChildrenCallback = () => Type<any> | NgModuleFactory<any> | Promise<NgModuleFactory<any>> | Promise<Type<any>> | Observable<Type<any>>;

export declare type Navigation = {
id: number;
Expand Down

0 comments on commit 26a8c59

Please sign in to comment.