Skip to content

Commit 5b672ea

Browse files
docs(lazyLoad): Remove references to JIT/AOT lazy loading differences, and @ngtools/webpack string based lazy loading mechanism
1 parent 721ec9c commit 5b672ea

File tree

1 file changed

+3
-46
lines changed

1 file changed

+3
-46
lines changed

src/interface.ts

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -135,67 +135,24 @@ export interface Ng2StateDeclaration extends StateDeclaration, Ng2ViewDeclaratio
135135
views?: { [key: string]: Ng2ViewDeclaration };
136136

137137
/**
138-
* A string or function used to lazy load an `NgModule`
138+
* A function used to lazy load an `NgModule`
139139
*
140140
* The `loadChildren` property should be added to a Future State (a lazy loaded state whose name ends in `.**`).
141141
* The Future State is a placeholder for a tree of states that will be lazy loaded in the future.
142142
*
143-
* When the future state is activated, the `loadChildren` property will lazy load an `NgModule`
143+
* When the future state is activated, the `loadChildren` property should lazy load an `NgModule`
144144
* which contains the fully loaded states.
145145
* The `NgModule` should contain the fully loaded states which will be registered.
146146
* The fully loaded states will replace the temporary future states once lazy loading is complete.
147147
*
148-
* ---
149-
*
150-
* When `loadChildren` is a string, it should be a relative path to the module code that will be lazy loaded.
151-
* It should follow the semantics of the Angular Router's `loadChildren` property.
152-
* The string will be split in half on the hash character (`#`).
153-
* The first half is the path to the module.
154-
* The last half is the named export of the `NgModule` inside the ES6 module.
155-
*
156148
* #### Example:
157-
*
158-
* home.module.ts
159-
*
160-
* ```
161-
* @NgModule({... })
162-
* export class HomeModule {};
163-
* ```
164-
*
165149
* ```js
166150
* var futureState = {
167151
* name: 'home.**',
168152
* url: '/home',
169-
* loadChildren: './home/home.module#HomeModule')
170-
* }
171-
* ```
172-
*
173-
*
174-
* As a function, it should return a promise for the `NgModule`
175-
*
176-
* #### Example:
177-
* ```js
178-
* var futureState = {
179-
* name: 'home.**',
180-
* url: '/home',
181-
* loadChildren: () => System.import('./home/home.module')
182-
* .then(result => result.HomeModule);
183-
* }
184-
* ```
185-
*
186-
* #### Example:
187-
* This shows the load function being exported for compatibility with the AoT compiler.
188-
* ```js
189-
* export function loadHomeModule() {
190-
* return System.import('./home/home.module')
153+
* loadChildren: () => import('./home/home.module')
191154
* .then(result => result.HomeModule);
192155
* }
193-
*
194-
* var futureState = {
195-
* name: 'home.**',
196-
* url: '/home',
197-
* loadChildren: loadHomeModule
198-
* }
199156
* ```
200157
*/
201158
loadChildren?: NgModuleToLoad;

0 commit comments

Comments
 (0)