Skip to content

Instantly share code, notes, and snippets.

@oleersoy
Last active November 12, 2019 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleersoy/b014ce2647684bb75fe27fea1b4a9cb2 to your computer and use it in GitHub Desktop.
Save oleersoy/b014ce2647684bb75fe27fea1b4a9cb2 to your computer and use it in GitHub Desktop.
ngAfterViewInit() {
// server-side search
fromEvent(this.input.nativeElement,'keyup')
.pipe(
untilDestroyed(this),
filter(Boolean),
debounceTime(150),
distinctUntilChanged(),
tap(async (event:KeyboardEvent) => {
console.log(`The input value is ${this.input.nativeElement.value}`);
})
)
.subscribe();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment