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

148 Views Asked by At

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)

1

There are 1 best solutions below

0
Muhammed Raseen On BEST ANSWER

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}" />