は私がion-input
にgoogle.maps.places.Autocomplete
を添付したいのですが、Ionic2にion-input
は<input>
要素をラップし、私はそれへのアクセスを取得する方法を見つけ出すことはできません。Ionic2のイオン入力からラップされた入力を取得するにはどうすればよいですか?
私はディレクティブを作成し、ElementRef
import {Directive, ElementRef, Input} from 'angular2/core';
@Directive({
selector: '[location-picker]'
})
export class LocationPicker {
constructor(el: ElementRef) {
console.log(el.nativeElement);
}
}
しかしnativeElement
包まれた入力を返しに渡さを使用してみました。
<ion-input location-picker="">
<input class="text-input ng-valid ng-dirty ng-touched" type="text" placeholder="" aria-labelledby="lbl-6" location-picker="" autocomplete="off" autocorrect="off">
<!--template bindings={}-->
<!--template bindings={}-->
<!--template bindings={}-->
</ion-input>
私もthisに似たカスタムコンポーネントを作成し、TextInput
にSearchbar
を切り替えてみましたが、TextInput doesn't have
.inputElement`てきました。
アイデアを歓迎します。
ありがとうございます!
ねえ、ありますあなたはどのようにGoogleの場所オートコンプリートイオン2を実装したの完全なコードを提供することができますか? :)。ありがとう – LeRoy