Deniz Bayar
Deniz Bayar

Reputation: 169

Angular 5-Google Maps Search Bar

I am new on Angular and I just started to developing an Angular web application using with google maps. I need to put a searchbar for autocomplate when start to write typing it should already starts to show most meaningful places. I have used some ready libraries like "@types/googlemaps" but it is not matching correctly on searching some places. Also I know google have an API for "Places search box" but it is for JavaScript. My question: -Is there any opportunity to use GoogleMaps Javascript API's in Angular 5 ?

Upvotes: 0

Views: 1098

Answers (1)

Basavaraj Bhusani
Basavaraj Bhusani

Reputation: 5673

You can write javascript code in Angular 5. So, include Google Map's JavaScript API library in your project.

How to include Google Map's JavaScript API library?

Ans: 1. Add the JS library URL to script array in angular-cli.json.

  1. Add the script tag in the index.html.

If you are using variables of Google Map library in service or components, declare them as below

declare var VARIABLE_NAME;
declare var map;  // e.g. for map variable.

Upvotes: 1

Related Questions