Answer the question
In order to leave comments, you need to log in
How to pass variable from $scope on click to Google Maps marker?
<map center="50.4501, 30.5234" zoom="11" style="height: 100%" data-tap-disabled="true">
<marker ng-repeat="item in items" on-click="go({{item.id}})" position="{{item.coords}}">
</marker>
</map>
Answer the question
In order to leave comments, you need to log in
Use normal Google Maps, put a bind('click', callback) on each marker at the end of each $scope.$apply() callback.
If you want to cheat, then do this:
<marker data-item="{{item.id}}" ng-repeat="item in items" onclick="go(this.dataset.item)" position="{{item.coords}}">
</marker>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question