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

Function ɵɵdeferOnInteraction

packages/core/src/defer/instructions.ts:664–692  ·  view source on GitHub ↗
(triggerIndex: number, walkUpTimes?: number)

Source from the content-addressed store, hash-verified

662 * @codeGenApi
663 */
664export function ɵɵdeferOnInteraction(triggerIndex: number, walkUpTimes?: number) {
665 const lView = getLView();
666 const tNode = getCurrentTNode()!;
667
668 if (ngDevMode) {
669 trackTriggerForDebugging(
670 lView[TVIEW],
671 tNode,
672 `on interaction${walkUpTimes === -1 ? '' : '(<target>)'}`,
673 );
674 }
675
676 if (!shouldAttachTrigger(TriggerType.Regular, lView, tNode)) return;
677
678 renderPlaceholder(lView, tNode);
679
680 // Avoid adding event listeners when this instruction is invoked on the server.
681 if (!(typeof ngServerMode !== 'undefined' && ngServerMode)) {
682 registerDomTrigger(
683 lView,
684 tNode,
685 triggerIndex,
686 walkUpTimes,
687 onInteraction,
688 () => triggerDeferBlock(TriggerType.Regular, lView, tNode),
689 TriggerType.Regular,
690 );
691 }
692}
693
694/**
695 * Creates runtime data structures for the `prefetch on interaction` deferred trigger.

Callers

nothing calls this directly

Calls 7

getLViewFunction · 0.90
getCurrentTNodeFunction · 0.90
trackTriggerForDebuggingFunction · 0.90
shouldAttachTriggerFunction · 0.90
renderPlaceholderFunction · 0.90
registerDomTriggerFunction · 0.90
triggerDeferBlockFunction · 0.90

Tested by

no test coverage detected