Search code examples
javascriptangulardictionaryngui

I want angular 4 ng2-ui/map places-auto-complete restricted to a specific country


Here is my code

<input class="form-control" placeholder="Pickup Location" places-auto-complete 
(place_changed)="pickupChanged($event)" formControlName="pickup_location" 
[types]="['geocode']" />

How do set options for the input type to restrict the value to a specific country(eg: uae)


Solution

  • I have added componentRestrictions with [types]="['(cities)']" which worked fine.

    <input class="search-set form-control" [(ngModel)]="placeFilter" places-auto-complete (place_changed)="placeChanged($event)" [types]="['(cities)']" [componentRestrictions]="{country: 'ae'}" [ngModelOptions]="{standalone: true}" />