A simple Angular2+ directive that adds a debounce to your input fields π
- [βοΈ] Delays the start of a function call
- [βοΈ] Checks whether the current input is sitting from previously entered value
npm i @mattewn99/ngx-debounce-input
Name | Type | Default Value | Description |
---|---|---|---|
delay | number | 500 | This is the time between key events before a user stops typing. |
Add the declaration to @NgModule
:
import { NgxDebounceInputModule } from '@mattewn99/ngx-debounce-input';
...
@NgModule({
imports: [
NgxDebounceInputModule
]
})
Use inside your HTML template
<input ngxDebounceInput (debounce)="search($event)" [(ngModel)]="myModel">