From 26a8c5961e1f0e0b49dff5983ddfcc8dfba28858 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Tue, 19 Mar 2019 10:08:31 +0000 Subject: [PATCH] fix(router): support NgFactory promise in loadChildren typings (#29392) The router loadChildren property already supports a promise that returns a NgModuleFactory, but the typings cause the compilation to fail. PR Close #29392 --- packages/router/src/config.ts | 4 ++-- tools/public_api_guard/router/router.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/router/src/config.ts b/packages/router/src/config.ts index e739f424c6..6d624b94c9 100644 --- a/packages/router/src/config.ts +++ b/packages/router/src/config.ts @@ -97,8 +97,8 @@ export type ResolveData = { * @see `Route#loadChildren`. * @publicApi */ -export type LoadChildrenCallback = () => - Type| NgModuleFactory| Promise>| Observable>; +export type LoadChildrenCallback = () => Type| NgModuleFactory| + Promise>| Promise>| Observable>; /** * diff --git a/tools/public_api_guard/router/router.d.ts b/tools/public_api_guard/router/router.d.ts index 3e3098ddf7..a9130c64b7 100644 --- a/tools/public_api_guard/router/router.d.ts +++ b/tools/public_api_guard/router/router.d.ts @@ -147,7 +147,7 @@ export declare class GuardsCheckStart extends RouterEvent { export declare type LoadChildren = string | LoadChildrenCallback; -export declare type LoadChildrenCallback = () => Type | NgModuleFactory | Promise> | Observable>; +export declare type LoadChildrenCallback = () => Type | NgModuleFactory | Promise> | Promise> | Observable>; export declare type Navigation = { id: number;