0

여기에 JSFiddle example
Everithing은 매우 쉽습니다. 하지만 자동 완성 양식에서 dirrect 입력 텍스트를 가져 오는 방법은 무엇입니까? 전체 텍스트 값입니까?Google 장소 API는 자동 완성 양식에서 입력 텍스트를 가져옵니다.

.getPlace()으로 전화하면 구조화 된 정보를 얻을 수 있지만 사용자 입력시 입력 텍스트에서 동일한 텍스트를 가져와야합니다.

var place = tbgeo.getPlace(); 

// How to get something like this => var userinput = tbgeo.InnerText; 

console.log(JSON.stringify(place)); 

var lat = place.geometry["location"]["k"] 
var lng = place.geometry["location"]["D"] 

var address = ''; 
if (place.address_components) { 
    address = [ 
     (place.address_components[0] && place.address_components[0].short_name || ''), 
     (place.address_components[1] && place.address_components[1].short_name || ''), 
     (place.address_components[2] && place.address_components[2].short_name || '') 
    ].join(' '); 
} 

답변

0

당신은 이런 일을 할 수

<div ng-app=""> 

<p>Name: <input type="text" ng-model="userInputText" ></p> 
Bind Name: <input type="text" ng-model="userInputText" > 

<!-- or use ng-bind instead of ng-model --> 
<p ng-bind="userInputText"></p> 

</div> 
관련 문제