【问题标题】:I want angular 4 ng2-ui/map places-auto-complete restricted to a specific country我想要 angular 4 ng2-ui/map places-autocomplete 限制到特定国家
【发布时间】:2019-04-01 11:33:17
【问题描述】:
这是我的代码
<input class="form-control" placeholder="Pickup Location" places-auto-complete
(place_changed)="pickupChanged($event)" formControlName="pickup_location"
[types]="['geocode']" />
如何为输入类型设置选项以将值限制为特定国家/地区(例如:阿联酋)
【问题讨论】:
标签:
javascript
angular
dictionary
ngui
【解决方案1】:
我添加了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}" />