Skip to main content
cngx-src documentation

CngxSearch

DirectivePrimaryv0.1.0

projects/common/interactive/keyboard/search.directive.ts

Import#

import { CngxSearch } from '@cngx/common/interactive'

Description#

Debounced search term tracker for <input> elements.

Converts the DOM input event stream into a debounced Signal. The raw Observable is never exposed - signal at the API boundary.

Basic usage

<input cngxSearch #search="cngxSearch" placeholder="Search..." />
<button (click)="search.clear()">Clear</button>

Metadata#

Index#

Properties

Methods

Derived State

Inputs#

debounceMs#number
input()

Debounce delay in milliseconds. @defaultValue 300

default 300

Outputs#

searchChange#string
output()

Emitted after each debounced input event with the new term.

Instance Properties#

term#unknown
Readonly

The current (debounced) search term.

this.termState.asReadonly()

Methods#

clear#void

Clears the search term and resets the input element value.