angular2-debounce is an Angular2 directive that adds a debounce to your input fields.
It delays the start of a function call after every keyup -event.
npm install angular2-debounce --save
Add the declaration to your @NgModule:
import {Debounce} from 'angular2-debounce';
...
@NgModule({
declarations: [
Debounce
]
})
Use directly inside your HTML templates
<input debounce [delay]="700" (func)="myDebouncedFunction()" [(ngModel)]="..." name="Debounce input" class="form-control input-sm">
This project is licensed under the MIT license. See the LICENSE file for more info.