MCPcopy Create free account
hub / github.com/angular/angular / ɵɵdeferPrefetchOnInteraction

Function ɵɵdeferPrefetchOnInteraction

packages/core/src/defer/instructions.ts:704–732  ·  view source on GitHub ↗
(triggerIndex: number | null, walkUpTimes?: number)

Source from the content-addressed store, hash-verified

702 * @codeGenApi
703 */
704export function ɵɵdeferPrefetchOnInteraction(triggerIndex: number | null, walkUpTimes?: number) {
705 const lView = getLView();
706 const tNode = getCurrentTNode()!;
707
708 if (ngDevMode) {
709 trackTriggerForDebugging(
710 lView[TVIEW],
711 tNode,
712 `prefetch on interaction${walkUpTimes === -1 ? '' : '(<target>)'}`,
713 );
714 }
715
716 if (!shouldAttachTrigger(TriggerType.Prefetch, lView, tNode)) return;
717
718 const tView = lView[TVIEW];
719 const tDetails = getTDeferBlockDetails(tView, tNode);
720
721 if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
722 registerDomTrigger(
723 lView,
724 tNode,
725 triggerIndex,
726 walkUpTimes,
727 onInteraction,
728 () => triggerPrefetching(tDetails, lView, tNode),
729 TriggerType.Prefetch,
730 );
731 }
732}
733
734/**
735 * Creates runtime data structures for the `on interaction` hydrate trigger.

Callers

nothing calls this directly

Calls 7

getLViewFunction · 0.90
getCurrentTNodeFunction · 0.90
trackTriggerForDebuggingFunction · 0.90
shouldAttachTriggerFunction · 0.90
getTDeferBlockDetailsFunction · 0.90
registerDomTriggerFunction · 0.90
triggerPrefetchingFunction · 0.90

Tested by

no test coverage detected