Is there a way to create an ng-click angularjs directive inside an infowindow content?
var infowindow = new google.maps.InfoWindow({
map: map,
position: pos,
content: '<div ng-click="???" class="infowindow"></div>'
});
You will need to compile the HTML element first with something like
var htmlElement = '<div ng-click="???" class="infowindow"></div>'
var compiled = $compile(htmlElement)($scope)
then set InfoWindow Content to be something like
var infowindow = new google.maps.InfoWindow({
map: map,
position: pos,
content: compiled[0]
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With