Skip to content

Commit f849602

Browse files
committed
feat(demo/api): document new configuration options
1 parent 7cc361b commit f849602

File tree

1 file changed

+152
-7
lines changed

1 file changed

+152
-7
lines changed

projects/elements-demo/src/app/features/docs/api/api.component.html

Lines changed: 152 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ <h2>LazyElementModule</h2>
148148
<code>*axLazyElementDynamic</code> directives so it has to be imported in
149149
other Angular modules which want to use these directives in the templates of
150150
their components. Module can be also pre-configured using
151-
<code>forRoot()</code> and <code>forFeature()</code> static methods by
152-
passing in <code>LazyElementModuleOptions</code> object.
151+
<code>forRoot()</code> and <code>forFeature()</code> static methods.
153152
</p>
154153
<mat-card>
155154
<table>
@@ -159,11 +158,14 @@ <h2>LazyElementModule</h2>
159158
</thead>
160159
<tbody>
161160
<tr>
162-
<td><pre>forRoot(options: LazyElementModuleOptions)</pre></td>
161+
<td><pre>forRoot(options: LazyElementModuleRootOptions)</pre></td>
163162
<td>
164163
<p>
165164
The <code>forRoot()</code> static method which accepts options of
166-
<code>LazyElementModuleOptions</code> type
165+
<code>LazyElementModuleRootOptions</code> type <br /><code
166+
color="accent"
167+
>Optional</code
168+
>
167169
</p>
168170
</td>
169171
</tr>
@@ -172,8 +174,123 @@ <h2>LazyElementModule</h2>
172174
<td>
173175
<p>
174176
The <code>forFeature()</code> static method which accepts options
175-
of <code>LazyElementModuleOptions</code> type
177+
of <code>LazyElementModuleOptions</code> type <br /><code
178+
color="accent"
179+
>Optional</code
180+
>
181+
</p>
182+
</td>
183+
</tr>
184+
</tbody>
185+
</table>
186+
</mat-card>
187+
</section>
188+
189+
<section>
190+
<h2>LazyElementModuleRootOptions</h2>
191+
<code color="accent">Interface</code>
192+
<br />
193+
<p>
194+
Type of an option object that can be passed to static
195+
<code>forRoot()</code> method of <code>LazyElementModule</code>.
196+
</p>
197+
<mat-card>
198+
<table>
199+
<thead>
200+
<th>Property</th>
201+
<th>Description</th>
202+
</thead>
203+
<tbody>
204+
<tr>
205+
<td><pre>elementConfigs: ElementConfig[]</pre></td>
206+
<td>
207+
<p>
208+
Optional array of <code>ElementConfig</code>... <br />
209+
<code color="accent">Optional</code>&nbsp;<code color="accent"
210+
>Default: []</code
211+
>
212+
</p>
213+
</td>
214+
</tr>
215+
<tr>
216+
<td><pre>rootOptions: LazyElementRootOptions</pre></td>
217+
<td>
218+
<p>
219+
Optional object of <code>LazyElementRootOptions</code>... <br />
220+
<code color="accent">Optional</code>&nbsp;<code color="accent"
221+
>Default: &#123; }</code
222+
>
223+
</p>
224+
</td>
225+
</tr>
226+
</tbody>
227+
</table>
228+
</mat-card>
229+
</section>
230+
231+
<section>
232+
<h2>LazyElementRootOptions</h2>
233+
<code color="accent">Interface</code>
234+
<br />
235+
<p>
236+
Type of an option object that can be passed as the
237+
<code>rootOptions</code> of the
238+
<code>LazyElementModuleRootOptions</code> into the
239+
<code>forRoot()</code> method of <code>LazyElementModule</code>. These
240+
options will be applied to every element loaded using
241+
<code>*axLazyElement</code> or
242+
<code>*axLazyElementDynamic</code> directives. These options can be
243+
overridden by the element configuration in <code>forFeature()</code> and
244+
lastly by the inline configuration of <code>*axLazyElement</code> directive.
245+
</p>
246+
<mat-card>
247+
<table>
248+
<thead>
249+
<th>Property</th>
250+
<th>Description</th>
251+
</thead>
252+
<tbody>
253+
<tr>
254+
<td><pre>loadingComponent: Type&#60;any></pre></td>
255+
<td>
256+
<p>
257+
Component class to be displayed during element loading (similar to
258+
<code>loadingTemplate</code> that can be specified inline in the
259+
template, eg
260+
<code>*axLazyElement="url; loadingTemplate: loading;"</code>)
176261
</p>
262+
<code color="accent">Optional</code>&nbsp;<code color="accent"
263+
>Default: undefined</code
264+
>
265+
</td>
266+
</tr>
267+
<tr>
268+
<td><pre>errorComponent: Type&#60;any></pre></td>
269+
<td>
270+
<p>
271+
Component class to be displayed after element loading failed
272+
(similar to
273+
<code>errorTemplate</code> that can be specified inline in the
274+
template, eg
275+
<code>*axLazyElement="url; errorTemplate: error;"</code>)
276+
</p>
277+
<code color="accent">Optional</code>&nbsp;<code color="accent"
278+
>Default: undefined</code
279+
>
280+
</td>
281+
</tr>
282+
<tr>
283+
<td><pre>isModule: boolean</pre></td>
284+
<td>
285+
<p>
286+
Flag that specifies if the element is loaded as bundle (default)
287+
or as module. This will influence the generated
288+
<code>&#60;script></code> tag which will get
289+
<code>type="module"</code> in case this flag was set to true.
290+
</p>
291+
<code color="accent">Optional</code>&nbsp;<code color="accent"
292+
>Default: undefined</code
293+
>
177294
</td>
178295
</tr>
179296
</tbody>
@@ -187,8 +304,7 @@ <h2>LazyElementModuleOptions</h2>
187304
<br />
188305
<p>
189306
Type of an option object that can be passed to static
190-
<code>forRoo()</code> and <code>forFeature()</code> methods of
191-
<code>LazyElementModule</code>.
307+
<code>forFeature()</code> method of <code>LazyElementModule</code>.
192308
</p>
193309
<mat-card>
194310
<table>
@@ -261,6 +377,35 @@ <h2>ElementConfig</h2>
261377
>
262378
</td>
263379
</tr>
380+
<tr>
381+
<td><pre>loadingComponent: Type&#60;any></pre></td>
382+
<td>
383+
<p>
384+
Component class to be displayed during element loading (similar to
385+
<code>loadingTemplate</code> that can be specified inline in the
386+
template, eg
387+
<code>*axLazyElement="url; loadingTemplate: loading;"</code>)
388+
</p>
389+
<code color="accent">Optional</code>&nbsp;<code color="accent"
390+
>Default: undefined</code
391+
>
392+
</td>
393+
</tr>
394+
<tr>
395+
<td><pre>errorComponent: Type&#60;any></pre></td>
396+
<td>
397+
<p>
398+
Component class to be displayed after element loading failed
399+
(similar to
400+
<code>errorTemplate</code> that can be specified inline in the
401+
template, eg
402+
<code>*axLazyElement="url; errorTemplate: error;"</code>)
403+
</p>
404+
<code color="accent">Optional</code>&nbsp;<code color="accent"
405+
>Default: undefined</code
406+
>
407+
</td>
408+
</tr>
264409
</tbody>
265410
</table>
266411
</mat-card>

0 commit comments

Comments
 (0)