Ionic 3:Google Maps Place自动填充仅工作一次

时间:2017-12-05 10:23:45

标签: javascript typescript ionic-framework google-places-api ionic3

我正在研究离子3,我已将Google Maps Place Autocomplete添加到输入标签中。 我添加了这些代码:

的index.html

ionViewDidEnter() {
  let places = document.getElementById('city').children[0];
  let autocomplete = new google.maps.places.Autocomplete(places);
}

页-controller.ts

.Select()

但是当我刷新页面时它只能工作一次。

事实上,如果我点击pageController中的保存按钮(保存用户数据并将我带回homeController)并返回此页面,则自动完成功能不再有效。

有人能帮助我吗?

0 个答案:

没有答案