MCPcopy Index your code
hub / github.com/angular/angular / render

Method render

packages/core/testing/src/defer.ts:36–52  ·  view source on GitHub ↗

* Renders the specified state of the defer fixture. * @param state the defer state to render

(state: DeferBlockState)

Source from the content-addressed store, hash-verified

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

Callers 4

i18n_spec.tsFile · 0.45
defer_spec.tsFile · 0.45

Calls 5

hasStateTemplateFunction · 0.85
triggerResourceLoadingFunction · 0.85
renderDeferBlockStateFunction · 0.85
detectChangesMethod · 0.45

Tested by

no test coverage detected