I want to use the ionic input with google map but it gives me an error :
(我想在Google地图上使用离子输入,但它给我一个错误:)
InvalidValueError: not an instance of HTMLInputElement
(InvalidValueError:不是HTMLInputElement的实例)
Here's the code :
(这是代码:)
HTML:
(HTML:)
<ion-item>
<ion-label position="floating">Destination</ion-label>
<ion-input #autoCompleteInputDestination formControlName="destination"></ion-input>
</ion-item>
ts file :
(ts文件:)
@ViewChild('autoCompleteInputDestination', {static: true}) inputNativeElementd: any;
// distination
const autocomplete2 = new google.maps.places.Autocomplete(this.inputNativeElementd.nativeElement as HTMLInputElement);
autocomplete2.addListener('place_changed', () => {
//some code
}
Any suggestions for this problem?
(对这个问题有什么建议吗?)
ask by toto totto translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…