5

I'm using Angular-google-map library to show markers with windows like this :

 <google-map center="map.center"
 zoom="map.zoom"
 draggable="true"
  bounds="" 
   options ="{styles:map.options}"
  >

    <marker ng-repeat="hotel in hotelsFiltered"
     idKey="hotel.id"
     coords="{latitude:hotel.latitude,longitude:hotel.longitude}"
     hoteldata="hotel"
     icon="icon">
    </marker>

    <window ng-repeat="hotel in hotelsFiltered"
     coords="{latitude:hotel.latitude,longitude:hotel.longitude}"
     templateUrl="hotel.templateUrl"
     templateParameter="{title:'myTitle'}"
     show="hotel.show"
    >

    </window>


</google-map>

so in the window directive i provided the templateUrl, and the markers displayed the info window successfully , but the problem is that the parameter that i provided in the templateParameter seem not to be accessible in the template view . here is my template view for the infoWindow and how i tried to access the passed parameter from the window directive:

<div>
 {{title}}
 the title was not showed successfully 
</div>
Omar Kayali
  • 53
  • 1
  • 5

1 Answers1

12

I had a very similar issue and the solution was to update the binding in the template as follows:

<div>
   {{parameter.title}}
</div>

The rest of your code can remain the same.

Kildareflare
  • 4,590
  • 5
  • 51
  • 65
  • You guys have a working example/plnkr? I am struggling with the same issue. – Juan Solano Nov 28 '14 at 21:45
  • Thanks, couldn't find this in the documentation at all. – Fisu Dec 18 '14 at 07:40
  • 3
    The docs are not the best, but there's an example at [https://github.com/angular-ui/angular-google-maps/blob/master/example/example.html](https://github.com/angular-ui/angular-google-maps/blob/master/example/example.html) - besides that HTML, see its related `/assets/scripts/controllers/example.js` and that JS controller's referenced template. – jmq Apr 16 '15 at 14:15