我想将角度4 ng2-ui /地图位置自动完成限制为特定国家/地区

时间:2018-10-28 09:46:38

标签: javascript angular dictionary ngui

这是我的代码

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

如何设置输入类型的选项以将值限制为特定国家(例如uae)

1 个答案:

答案 0 :(得分:0)

我添加了componentRestrictions[types]="['(cities)']"效果很好。

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