I'm quite new to angular and would appreciate some help. I wanna make a function that call service with a google placeid as parameter and I want that service to return me the detailed google place object. I want to be able to access placeResult value in my component.ts and really have a hard time.
This is my function my service.ts file
getPlaceDetails(placeid: string) {
this.getPlaceService.getDetails({
placeId: placeid
}, (placeResult, status) => {
if(status === 'OK') {
return placeResult;
}
});
}
and this is where I call my service function in my component.ts file
selectCity(res) {
this.httpService.getPlaceDetails(res['item']['place_id']).subscribe(data => {
console.log(data);
});
}