docs: update defer section to Markdown and fix absolute URL to relative in adev

(cherry picked from commit 098553bfe4)
This commit is contained in:
SkyZeroZx 2026-03-24 13:13:05 -05:00 committed by Leon Senft
parent a0ca5a50b2
commit e8c047bd8d
2 changed files with 9 additions and 43 deletions

View file

@ -2,31 +2,11 @@
Deferrable views let you define content to be shown in different loading states.
<div class="docs-table docs-scroll-track-transparent">
<table>
<tr>
<td><code>@placeholder</code></td>
<td>
By default, defer blocks do not render any content before they are triggered. The <code>@placeholder</code> is an optional block that declares content to show before the deferred content loads. Angular replaces the placeholder with the deferred content after loading completes. While this block is optional, the Angular team recommends always including a placeholder.
<a href="https://angular.dev/guide/templates/defer#triggers" target="_blank">
Learn more in the full deferrable views documentation
</a>
</td>
</tr>
<tr>
<td><code>@loading</code></td>
<td>
This optional block allows you to declare content to be shown during the loading of any deferred dependencies.
</td>
</tr>
<tr>
<td><code>@error</code></td>
<td>
This block allows you to declare content which is shown if deferred loading fails.
</td>
</tr>
</table>
</div>
| Block | Description |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@placeholder` | By default, defer blocks do not render any content before they are triggered. The `@placeholder` is an optional block that declares content to show before the deferred content loads. Angular replaces the placeholder with the deferred content after loading completes. While this block is optional, the Angular team recommends always including a placeholder. [Learn more in the full deferrable views documentation](guide/templates/defer) |
| `@loading` | This optional block allows you to declare content to be shown during the loading of any deferred dependencies. |
| `@error` | This block allows you to declare content which is shown if deferred loading fails. |
The contents of all the above sub-blocks are eagerly loaded. Additionally, some features require a `@placeholder` block.

View file

@ -6,24 +6,10 @@ By default, deferred content loads when the browser is idle. You can, however, c
Deferrable views offer two types of loading trigger:
<div class="docs-table docs-scroll-track-transparent">
<table>
<tr>
<td><code>on</code></td>
<td>
A trigger condition using a trigger from the list of built-in triggers.<br/>
For example: <code>@defer (on viewport)</code>
</td>
</tr>
<tr>
<td><code>when</code></td>
<td>
A condition as an expression which is evaluated for truthiness. When the expression is truthy, the placeholder is swapped with the lazily loaded content.<br/>
For example: <code>@defer (when customizedCondition)</code>
</td>
</tr>
</table>
</div>
| Trigger | Description |
| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `on` | A trigger condition using a trigger from the list of built-in triggers.<br/>For example: `@defer (on viewport)` |
| `when` | A condition as an expression which is evaluated for truthiness. When the expression is truthy, the placeholder is swapped with the lazily loaded content.<br/>For example: `@defer (when customizedCondition)` |
If the `when` condition evaluates to `false`, the `defer` block is not reverted back to the placeholder. The swap is a one-time operation.