Skip to main content
cngx-src documentation

CngxPaginateResetOn

DirectivePrimaryv0.1.0WCAG AA

projects/common/data/paginate/paginate-reset.directive.ts

Import#

import { CngxPaginateResetOn } from '@cngx/common/data'

Description#

Resets a cngxPaginate host to the first page whenever the bound key changes - the composable form of connectPaginateResetOn.
Drop it on the same element as cngxPaginate (or a CngxPaginator / CngxMatPaginator, which provide the brain), and bind the sort / filter / search value a result set depends on, so a narrowed result never strands the user on a now-empty page.

Bind a primitive or a computed - an inline array / object literal recomputes every change-detection pass and would reset on each.

<table cngxPaginate [cngxPaginateResetOn]="filter()"><!-- ... --></table>

https://cngxjs.github.io/cngx/examples/#/ui/paginator/paginator-behaviors/reset-on-filter

Metadata#

Index#

Inputs

Inputs#

key#unknown
input()

The reset key. A change (after mount) jumps the paginator to page 0.

default undefined, { alias: 'cngxPaginateResetOn' }