Facebook
From Baby Pintail, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 235
  1. observableSource = (keyword: any): Observable<any[]> => {
  2.         let url: string = '/api/search/' + keyword;
  3.  
  4.         if (keyword) {
  5.             return this.http.get(url)
  6.                 .map(res => {
  7.                     let json = res.json();
  8.                     return json;
  9.                 })
  10.         } else {
  11.             return Observable.of([]);
  12.         }
  13.     }