Reputation: 465
I need a marker ui-gmap-windows click event to pass in the marker id when it's clicked on. I'm sure there's a way to do it, I just can't figure it out.
Here's the HTML:
<ui-gmap-google-map center='map.center' zoom='map.zoom' id='map-canvas' options="options">
<ui-gmap-markers models="markers" options="'options'" coords="'coords'" idKey="'id'">
<ui-gmap-windows show="'show'" closeClick="'closeClick'">
<div ng-controller="updateResortController" ng-click="markerClick(id)">
<span ng-non-bindable id="{{id}}">{{title}} : {{id}}</span>
</div>
</ui-gmap-windows>
</ui-gmap-markers>
</ui-gmap-google-map>
You can see the controller registered to the window. The click event works, The function runs, but 'id' is undefined.
I'm trying to keep it simple but let me know if you need to see the script. Thanks!
Upvotes: 1
Views: 514
Reputation: 465
Well I guess I just needed a night to think it over. For those of you who're interested, I used: $parent.model.id (id is specific to my application). So:
ng-click="markerClick($parent.model.id)"
Upvotes: 1