CngxPaginatorInfinite
projects/ui/paginator/segments/paginator-infinite.component.ts
Import#
import { CngxPaginatorInfinite } from '@cngx/ui/paginator'
Description#
Infinite-scroll segment: a bottom-of-list sentinel that auto-advances the
page as it scrolls into view, composing CngxInfiniteScroll.
The in-template sentinel binds the directive's [enabled] / [loading] inputs and its
(loadMore) output directly to the CNGX_PAGINATOR_HOST signals, so the
directive's built-in debounce, busy-gate, enabled-disable, and auto-disconnect
own the auto-advance double-fire guard - this segment adds no
IntersectionObserver code of its own.
The directive sits on the sentinel element (not as a hostDirective) precisely so its [enabled] / [loading]
inputs can bind to the host-token signals; a static hostDirectives
declaration could not express that wiring.
Like cngx-pgn-load-more, this stays a thin trigger atom: it injects
CNGX_PAGINATOR_HOST, holds no accumulation state, and renders no async view
of its own.
The consumer slices its own array from the brain's
cumulativeRange(); the busy / error / end experience belongs to the consumer
or to a composing container, keeping the segment reusable unchanged.
Exhausted state: once host.isLast() the sentinel disables (enabled is
false, so the observer disconnects).
It swaps its busy affordance for the
allLoaded end label only after the final load settles (!host.isBusy()),
so it never claims "all loaded" while the last batch is still arriving, and
the tail is never a silent or stale spinner.
[root] / [rootMargin] forward straight to the composed directive so a
consumer can point the sentinel at a bounded scroll container (a feed box)
rather than the viewport, and tune the pre-fetch distance. They are plain
passthrough config - the segment still owns no observer code and no state.
Metadata#
Dependencies#
CNGX_PAGINATOR_HOSTinject()host