ng2-google-place-autocomplete
Google-Autocomplete-Angular2 Directive/Component
This is a Google-Autocomplete Directive/Component for Angular 2.
Build with angular-cli 1.0.0-beta.30 and @angular 2.4.6
Demo page
GitHub
Please feel free to declare issues or contribute : https://github.com/psykolm22/ng2-google-place-autocomplete
Installation
npm i --save ng2-google-place-autocomplete
Don't forget to add google api in your index.html
- in your index.html:
Usage
- Use it in your HTML elements, for example:
- Add GooglePlaceModule in your app.module.ts:
; @
Options
Options for Google Search
- Choose one type from
[ '(cities)', '(regions)', 'country', 'postal_code', 'sublocality', 'establishment', 'address', 'geocode']
- country ( dynamic change allow) : CountryCode ISO 3166-1 Alpha-2 ( see demo )
[options]="{ types: [], componentRestrictions: { country: 'FR' } }"
Tested in:
- Chrome
- Firefox
- Safari