-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for lazy loading NgModules
BREAKING CHANGE: The input for lazy loading has change from [loadComponent] to [load] to support components and NgModules BEFORE: <route path="/path" [loadComponent]=""></route> AFTER: <route path="/path" [load]=""></route>
- Loading branch information
1 parent
5c0b345
commit 0d2aa76
Showing
6 changed files
with
68 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
import { Type } from '@angular/core'; | ||
import { Type, NgModuleFactory } from '@angular/core'; | ||
|
||
import { Params } from './route-params.service'; | ||
|
||
export type LoadComponent = () => Promise<Type<any>>; | ||
export type Load = () => Promise<NgModuleFactory<any>|Type<any>|any>; | ||
|
||
export interface Route { | ||
path: string; | ||
// component?: Type<any>; | ||
loadComponent?: LoadComponent; | ||
load?: Load; | ||
matcher?: RegExp; | ||
} | ||
|
||
export interface ActiveRoute { | ||
route: Route; | ||
params: Params; | ||
} | ||
|
||
export interface ModuleWithRoute { | ||
routeComponent: Type<any>; | ||
} |