1
このjs関数をどのように角をつけますか?非同期で使用する必要があります。私の理解は、その後、角度がそれを行うことができます。jsコールバック関数を約束通りに変換する.then
あなたはこのような何か行うことができますfunction showResult(result) {
var lat = result.geometry.location.lat();
var long = result.geometry.location.lng();
$scope.vm.showroom.Longitude = long;
$scope.vm.showroom.Latitude = lat;
}
function GetLatitudeLongitude(callback, address) {
var address1 = address || '234 eisenhower avenue salt lake city';
// Initialize the Geocoder
var geocoder = new google.maps.Geocoder();
if (geocoder) {
geocoder.geocode({
'address': address1
}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
callback(results[0]);
}
});
}
}
角度 HTTPSでの '$のq'サービスをチェックアウト: //docs.angularjs.org/api/ng/service/$q – LoganRx