我只想通过ngAutocomplete.js向所有印度城市提供选项......远低于ngAutocomplete.js的代码
android {
...
defaultConfig {...}
buildTypes {...}
productFlavors {
tablet {
applicationIdSuffix ".tablet"
versionNameSuffix "-tablet"
}
phone {
applicationIdSuffix ".phone "
versionNameSuffix "-phone "
}
}
答案 0 :(得分:1)
幸运的是,Google JS文档中有Autocomplete: Restrict the search to a specific country。此功能使用componentRestrictions
选项将自动完成搜索限制为特定国家/地区。这是给你的片段:
var input = document.getElementById('searchTextField');
var options = {
types: ['(cities)'],
componentRestrictions: {country: 'in'}
};
autocomplete = new google.maps.places.Autocomplete(input, options);
以下是Google地图示例中的full working demo。
答案 1 :(得分:0)
$scope.getOnlyINDIA = {
country: 'in',
types: '(cities)'
};
将其添加到控制器中,然后添加到自动完成文本框添加...
options="getOnlyINDIA"