I get the data from my server like so
private allData(input:string): Observable<any> {
let params = new HttpParams().set('q', input);
return this.httpClient.get(Configuration.getData(url), { params: params });
}
public getDataService(){
return this.dataService = (term: string) => this.allData(term);
}
and in my controller, i would like to check the status of the request above to execute a specific UI action. Here is how i subscribe my data:
this.getDataService().subscribe(
res => this.httpData = res.results,
err => console.warn(err),
() => {
this.loading.dismiss() /*close loader*/
}
)
I have this error :“Property subscribe does not exist on type ‘(term:string) => Observable’”
Any help ?