( triggerIndex: number, walkUpTimes?: number | null, options?: IntersectionObserverInit, )
| 807 | * @codeGenApi |
| 808 | */ |
| 809 | export function ɵɵdeferPrefetchOnViewport( |
| 810 | triggerIndex: number, |
| 811 | walkUpTimes?: number | null, |
| 812 | options?: IntersectionObserverInit, |
| 813 | ) { |
| 814 | const lView = getLView(); |
| 815 | const tNode = getCurrentTNode()!; |
| 816 | |
| 817 | if (ngDevMode) { |
| 818 | const args: string[] = []; |
| 819 | if (walkUpTimes !== undefined && walkUpTimes !== -1) { |
| 820 | args.push('<target>'); |
| 821 | } |
| 822 | if (options) { |
| 823 | args.push(JSON.stringify(options)); |
| 824 | } |
| 825 | trackTriggerForDebugging( |
| 826 | lView[TVIEW], |
| 827 | tNode, |
| 828 | `prefetch on viewport${args.length === 0 ? '' : `(${args.join(', ')})`}`, |
| 829 | ); |
| 830 | } |
| 831 | |
| 832 | if (!shouldAttachTrigger(TriggerType.Prefetch, lView, tNode)) return; |
| 833 | |
| 834 | const tView = lView[TVIEW]; |
| 835 | const tDetails = getTDeferBlockDetails(tView, tNode); |
| 836 | |
| 837 | if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) { |
| 838 | registerDomTrigger( |
| 839 | lView, |
| 840 | tNode, |
| 841 | triggerIndex, |
| 842 | walkUpTimes, |
| 843 | onViewportWrapper, |
| 844 | () => triggerPrefetching(tDetails, lView, tNode), |
| 845 | TriggerType.Prefetch, |
| 846 | options, |
| 847 | ); |
| 848 | } |
| 849 | } |
| 850 | |
| 851 | /** |
| 852 | * Creates runtime data structures for the `on viewport` hydrate trigger. |
nothing calls this directly
no test coverage detected