/** Angular Imports */ import { Injectable } from '@angular/core' ; import { HttpClient , HttpParams } from '@angular/common/http' ; /** rxjs Imports */ import { Observable } from 'rxjs' ; /**
 * Search service.
 */ @ Injectable ( { providedIn : 'root' } ) export class SearchService { param { HttpClient } http constructor ( private http ) { } param { string } query param { string } resource returns { Observable < any > } getSearchResults ( query , resource ) { const httpParams = new HttpParams ( ) . set ( 'exactMatch' , 'false' ) . set ( 'query' , query ) . set ( 'resource' , resource ) ; return this . http . get ( '/search' , { params : httpParams } ) ; } }