Ng-show/ng-hide/ng-if on Google Maps


#1

Hi Guys,
Unfortunately I have a problem,
I have a marker on Google Maps that triggers an event to show a detail card.
I tested the console and it is changing the variable, but it never activates the ng-show.
Already tested with the ng-show, ng-hide and ng-if, all of them change the variable value but never update my view.

Does anyone have any idea of any workaround?


#2

< marker id=“foo” position="{{item.Geolocation.Latitude}},{{item.Geolocation.Longitude}}" on-click=“showInfoWindow(event, ‘bar’)” >
< /marker>
< info-window id=“bar”>
< div ng-non-bindable="">
< div id=“siteNotice”>
< div id=“bodyContent”>
< p>< b>Debit Card Details< /b>< /p>
</ div>
</ div>
</ info-window>


#3

Thank you, but I found a way to make it update.

I don’t know if it is the best way.

But the problem was that the Scope wasn’t updating

google.maps.event.addListener(marker, ‘click’, function() {
$scope.details = !$scope.details;
$scope.$apply()
});

So I used this. Don’t know if it is the best way, but it is working =)