Javascript 谷歌自动完成的角度

Javascript 谷歌自动完成的角度,javascript,angularjs,google-maps-api-2,Javascript,Angularjs,Google Maps Api 2,我有问题与谷歌自动完成在角度 结构是index.html,带有 我有一个页面显示在ng view-road.html中 Road.html <input id="locationFrom" type="text" class="form-control"/> 我在控制台中并没有错误,输入得到了额外的占位符“Write locations…”,但当我输入时,并没有像应该的那个样的提示 我做错了什么?首先将依赖项添加到应用程序: angular.module('myApp', ['g

我有问题与谷歌自动完成在角度

结构是index.html,带有

我有一个页面显示在ng view-road.html中

Road.html

<input id="locationFrom"  type="text" class="form-control"/>
我在控制台中并没有错误,输入得到了额外的占位符“Write locations…”,但当我输入时,并没有像应该的那个样的提示


我做错了什么?

首先将依赖项添加到应用程序:

angular.module('myApp', ['google.places']);
之后

angular.module('myApp', ['google.places']);
var defaultBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(-33.8902, 151.1759),
new google.maps.LatLng(-33.8474, 151.2631));

var input = document.getElementById('locationFrom');
var options = {
  bounds: defaultBounds,
  types: ['establishment']
};

autocomplete = new google.maps.places.Autocomplete(input, options);