Angular google map window directive with templateParameter attribute

I use the 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 templateUrl and the markers successfully displayed the info window, but the problem is that the parameter that I provided in the Parameter template does not seem to be available in the template view. here is my template view for infoWindow and how I tried to access the passed parameter from the window directive:

 <div> {{title}} the title was not showed successfully </div> 
+5
source share
1 answer

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

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

The rest of your code may remain the same.

+12
source

Source: https://habr.com/ru/post/1200845/


All Articles