In Angular1, I was able to add add debounce time for ng-model.
In Angular2, we can detect changes on all input. Is it possible to have some debounce time on each input change.
From the following plunker example, http://plnkr.co/edit/JKYSek?p=preview, I type "hello world", but it reacts to every single key stroke.
Is it possible to have some delay on each change without any programming?
import { Directive, OnChanges } from "@angular/core";
@Directive({
selector: '[my-directive]',
inputs: [`myInput`]
})
export class MyDirective implements OnChanges {
ngOnChanges(changes: {[key: string]: SimpleChange}) {
console.log('changes :'+ changes.myInput.currentValue);
}
}
