JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.10.0.min.js"></script>
<div ng-controller="TypeaheadCtrl">
<h4>Yandex Geocode</h4>
<pre>Адрес: {{asyncSelected | json}}</pre>
<input type="text" ng-model="asyncSelected" placeholder="Введите адрес" typeahead="address for address in getLocation($viewValue) | filter:$viewValue" typeahead-loading="loadingLocations" class="form-control">
<i ng-show="loadingLocations" class="glyphicon glyphicon-refresh"></i>
</div>
<a href="wtai://wp/mc;18475555555">Click Here To Call Support 1-847-555-5555</a>
JavaScript
angular.module('typeaheadApp', ['ui.bootstrap']).controller('TypeaheadCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.getLocation = function(val) {
return $http({method: 'GET', url: 'http://geocode-maps.yandex.ru/1.x/', headers: {
'Content-Type': 'application/json'
}, params: {
geocode: val,
format: 'json'
}}).then(function(data) {
console.log(data.data);
var addresses = [];
angular.forEach(data.data.response.GeoObjectCollection.featureMember, function(item) {
addresses.push(item.GeoObject.metaDataProperty.GeocoderMetaData.text);
});
return addresses
});
};
}]);