3

I have this structure:

  • myFolder
    • myApp.coffee
    • index.html
    • searchbox.tpl.html

And in myApp setting:

$scope.searchbox = {template: "searchbox.tpl.html"}

I'm using this example but i got TypeError: Cannot read property 'SearchBox' of undefined, what could be?

Daniel
  • 567
  • 6
  • 20

2 Answers2

4

You can use angular-google-maps in two ways:

1) by including the API before angular-google-maps.
...In that case you need to include the library places, this way:

<script src='//maps.googleapis.com/maps/api/js?libraries=places&sensor=false&language=pt&v=3.17'></script>
                                                           ^
                                                        see? there

2) by using .config (recommended).
...In that case you need to include the library places this way:

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
    });
}]);
sports
  • 7,851
  • 14
  • 72
  • 129
3

Is necessary include libraries=places

<script src='//maps.googleapis.com/maps/api/js?libraries=places&sensor=false&language=pt&v=3.17'></script>
Daniel
  • 567
  • 6
  • 20