I am using ionic 3 and i want to get the input and add some autocomplete on it using google maps. I have the following alert in my .ts file.
let alert = this.alertCtrl.create({
title: 'Offer a Ride',
inputs: [
{
name: 'From',
placeholder: 'From',
id: 'From'
},
{
name: 'To',
placeholder: 'To',
type: 'text',
id: 'To'
},
{
name: 'Date',
placeholder: 'Date',
type: 'date'
}
],
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: data => {
console.log('Cancel clicked');
elem.style.filter='none';
}
},
{
text: 'Offer',
handler: data => {
elem.style.filter='none';
var from = data.From;
var to = data.To;
//this.navCtrl.setRoot (TabsPage, {from:from, to:to});
let toast = this.toastCtrl.create({
message: 'Location was set Successfully',
duration: 3000
});
toast.present();
}
}
]
});
I want to do the following:
var autocomplete;
autocomplete = new google.maps.places.Autocomplete(
(document.getElementById('From')),
{types: ['geocode']});
However, I cannot get the input of id 'From'. Any idea how to do this?