【发布时间】:2017-12-15 12:36:19
【问题描述】:
我曾经使用google api获取当前地址,现在我想使用angular 4在这个函数中实现回调函数如何实现它?
let currgeocoder = new google.maps.Geocoder();
currgeocoder.geocode({
'location': location
}, function(results:any, status:any) {
if (status == google.maps.GeocoderStatus.OK) {
let place = results[0];
//this.showresult(place.formatted_address);
} else {
alert('Geocode was not successful for the following reason: ' + status);
}
});
this.myGroup.setValue({
searchControl: 'global'
});
【问题讨论】:
-
如果您需要任何事情,请查看我的回答
标签: angularjs angular function callback