@@ -135,67 +135,24 @@ export interface Ng2StateDeclaration extends StateDeclaration, Ng2ViewDeclaratio
135
135
views ?: { [ key : string ] : Ng2ViewDeclaration } ;
136
136
137
137
/**
138
- * A string or function used to lazy load an `NgModule`
138
+ * A function used to lazy load an `NgModule`
139
139
*
140
140
* The `loadChildren` property should be added to a Future State (a lazy loaded state whose name ends in `.**`).
141
141
* The Future State is a placeholder for a tree of states that will be lazy loaded in the future.
142
142
*
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`
144
144
* which contains the fully loaded states.
145
145
* The `NgModule` should contain the fully loaded states which will be registered.
146
146
* The fully loaded states will replace the temporary future states once lazy loading is complete.
147
147
*
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
- *
156
148
* #### Example:
157
- *
158
- * home.module.ts
159
- *
160
- * ```
161
- * @NgModule ({... })
162
- * export class HomeModule {};
163
- * ```
164
- *
165
149
* ```js
166
150
* var futureState = {
167
151
* name: 'home.**',
168
152
* 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')
191
154
* .then(result => result.HomeModule);
192
155
* }
193
- *
194
- * var futureState = {
195
- * name: 'home.**',
196
- * url: '/home',
197
- * loadChildren: loadHomeModule
198
- * }
199
156
* ```
200
157
*/
201
158
loadChildren ?: NgModuleToLoad ;
0 commit comments