【问题标题】: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)']",效果很好。

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

    【讨论】:

      猜你喜欢
      • 2017-08-28
      • 2017-08-05
      • 2015-09-03
      • 2012-07-23
      • 2016-06-22
      • 2020-10-04
      • 2013-07-31
      • 2018-03-22
      • 2018-08-14
      相关资源
      最近更新 更多