SHARE
TWEET

Untitled

a guest Apr 10th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public onInputChanged($event) {
  2.         Observable.fromEvent($event.target, "input")
  3.             .debounceTime(1000)
  4.             .distinctUntilChanged()
  5.             .map((event: any) => {
  6.                 return event.target.value;
  7.             })
  8.             .subscribe((value) => {
  9.                 console.log(value); // test <= 4x
  10.                 this.search(value);
  11.             });
  12.     }
  13.  
  14.     private search(searchCriteria: string) {
  15.         this.globalSearchService.search(searchCriteria)
  16.             .subscribe();
  17.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top