dylanfprice / angular-gm

AngularJS Google Maps Directives
MIT License
197 stars 47 forks source link

ng-click in an info window not firing #44

Open gmuirhead opened 10 years ago

gmuirhead commented 10 years ago

After updating to the latest build (1.0) I have noticed that ng-clicks on the info window have stopped working.

I have modified the info window example fiddler to include an ng-click as follows:

{{selectedVolcano.name}}

{{selectedVolcano.elevationMeters}}m

Any ideas or thoughts would be helpful.

Thanks, Gregory

gmuirhead commented 10 years ago

I have found the cause, due to teh DOM objects getting removed and replaced with the empty DIV, the note regarding compilation is helpful but it would have been helpful further for the directive to offer that as an optional parameter for folks.

thmelo commented 10 years ago

A workaround that I found. It access the $scope from outside.

$(document).on('click','.report', function(e){ e.preventDefault(); var scope = angular.element($(".content")).scope(); scope.$apply(function(){ scope.reportSpot(); }) });