[r1-dev] [blocker] ng-click inside infowindow not triggered
Hi Nicolas first of all thanks for the great work, been using the dev branch and it's really awesome.
Just one issue I've been struggling with: I can't get a ng-click on an element within an infowindow (as a directive within a marker directive within the map) to work. There's no error anywhere it just won't trigger. This is weird cause it seems the content is compiled correctly by Angular as the databinding works inside that infowindow, and I've been able to use ng-show and others inside it.
I suspect google maps API is doing something funny with the click events and I've been able to use onclick="" and element.bind() but that's not really a satisfying solution.
I am not that much proficient with Angular directive so would you have any advice to try to fix this?
Cheers
Is this issue still in existence? If so I will look into it. Can you provide small snippet?
Using the example page would be great.
Hi Nem, thanks for looking into that. I've just wrote this plunker to highlight the issue: http://plnkr.co/edit/ImqKKE?p=preview
The ng-click="helloWorld()" works on an element outside the map, but not inside an infowindow within the map. I figured out it was because the infowindow has its own local scope, but even putting the helloWorld() function into the $rootScope doesnt work.
Do you think there is a way to trigger that ng-click successfully?
Hey,
The issue is still there and my brief tries to fix it were unsuccessful. Have you have the chance to look at it ?
Cheers
Just wondering if anyone has found a workaround for this.
Thanks.
I believe I am working on this now and it is a confirmed problem. I found it while working on specs, this weekend. The click is currently getting triggered in feature/more_specs, but the Window is rendering in the wrong place partially.
Help is appreciated on this task as I could use more eyes on it.
Marked issue as blocking as r1-dev will not get moved to master until this is fixed. from @nmccready @nlaplante
See trello board, https://trello.com/c/dibkH4sN/17-fix-window-directive-marker-clicking-example-is-broken-best-to-use-feature-more-spec-as-the-specs-are-further-along-getting-some
Hi Nicolas, Great work man! Has a solution for this issue been found? Thanks, Mike.
I have the latest version of angular-google-maps yet I still have this problem. Im not sure why this issue is closed.
Any updates on this fix?
This is fixed it is on develop. #243
It is just on develop, currently here is the example. https://github.com/nlaplante/angular-google-maps/blob/develop/example/example.html#L66
It should work with markers as well.
Develop will be merged as soon as I can more help with closing the remaining milestone tickets is appreciated.
It should be noted that you don't need to use a separate Controller for the ng-click handler function.
The templateParameter attribute of the window directive is exposed in the isolated window scope of the inner HTML of the directive, not just when templateUrl is used (as is documented).
You will need to set the templateParameter attribute with a function reference to a handler in your controller. To call it from inside your template or inner HTML, it is exposed via the templateParameter key in the isolated window scope. If your function requires additional parameters, use an object to provide the function reference and parameters to the isolated window scope.
The documentation in the website-develop branch has been updated to clarify that this parameter is not limited to be used only with the templateUrl parameter.
Hi - do you know when this will be implemented into the most up-to-date version?
Also after this, it currently does not work :-(
Yes not on master develop hopefully soon. I think I may get some time this week (fingers crossed).
Here is a workaround to the above problem:
You can invoke ng-click handler function from inside the info window by using $parent service like this:
