I was trying to create an autocomplete input field with angular 4. I'm new to the angular framework and Typescript. From requirements, I should implement by using angular 4(Typescript). But the response of the API is not good when working with angular 4. Actually, I wanted to create 'place autosuggestion' thing. But got the following response...
Observable {_isScalar: false, source: Observable, operator: MapOperator}
If you are familiar with this kind of issues, Please suggest me the right way to solve this issue. Thanks in advance.
google.service.ts
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/Rx';
@Injectable()
export class GooglePlaces {
constructor(private http: Http) {}
getPlaces(place) {
const key = "xxxxxxxxxxxx-axxxxxx-xxxxaxx";
return this.http.get("https://maps.googleapis.com/maps/api/place/autocomplete/json?input="+place+"&components=country:in&key="+key).map(res => res.json());
}
}