* Renders the specified state of the defer fixture. * @param state the defer state to render
(state: DeferBlockState)
| 34 | * @param state the defer state to render |
| 35 | */ |
| 36 | async render(state: DeferBlockState): Promise<void> { |
| 37 | if (!hasStateTemplate(state, this.block)) { |
| 38 | const stateAsString = getDeferBlockStateNameFromEnum(state); |
| 39 | throw new Error( |
| 40 | `Tried to render this defer block in the \`${stateAsString}\` state, ` + |
| 41 | `but there was no @${stateAsString.toLowerCase()} block defined in a template.`, |
| 42 | ); |
| 43 | } |
| 44 | if (state === DeferBlockState.Complete) { |
| 45 | await triggerResourceLoading(this.block.tDetails, this.block.lView, this.block.tNode); |
| 46 | } |
| 47 | // If the `render` method is used explicitly - skip timer-based scheduling for |
| 48 | // `@placeholder` and `@loading` blocks and render them immediately. |
| 49 | const skipTimerScheduling = true; |
| 50 | renderDeferBlockState(state, this.block.tNode, this.block.lContainer, skipTimerScheduling); |
| 51 | this.componentFixture.detectChanges(); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Retrieves all nested child defer block fixtures |
no test coverage detected