我有这个结构:
- 我的文件夹
- myApp.coffee
- 索引.html
- 搜索框.tpl.html
在 myApp 设置中:
$scope.searchbox = {template: "searchbox.tpl.html"}
我正在使用这个例子,但我得到了TypeError: Cannot read property 'SearchBox' of undefined,可能是什么?
我有这个结构:
在 myApp 设置中:
$scope.searchbox = {template: "searchbox.tpl.html"}
我正在使用这个例子,但我得到了TypeError: Cannot read property 'SearchBox' of undefined,可能是什么?
您可以通过angular-google-maps
两种方式使用:
1)通过包含之前的API angular-google-maps
。
...在这种情况下,您需要通过places
以下方式包含 library :
<script src='//maps.googleapis.com/maps/api/js?libraries=places&sensor=false&language=pt&v=3.17'></script>
^
see? there
2)通过使用.config
(推荐)。
...在这种情况下,您需要以places
这种方式包含库:
angular.module('myApp').config(['uiGmapGoogleMapApiProvider', function(uiGmapGoogleMapApiProvider) {
uiGmapGoogleMapApiProvider.configure({
// key: 'your api key',
v: '3.20', //defaults to latest 3.X anyhow
libraries: 'places,geometry,visualization' // <--- see? there
});
}]);
必须包括图书馆=地点
<script src='//maps.googleapis.com/maps/api/js?libraries=places&sensor=false&language=pt&v=3.17'></script>