angular-ui/ui-map

map-event binder not taking arguments

facuferrari opened this issue · 1 comments

When I try to place markers it returns me Cannot read property latLng of undefined.

<div ng-repeat="marker in myMarkers" 
     ui-map-marker="myMarkers[$index]"
     ui-event="{'map-click': 'markerClicked(marker)'}">
</div>

//Module
angular.module('Maptesting', ['ui.map', 'ui.event'])
.controller('CtrlGMap', ['$scope', function($scope) {

    $scope.mapOptions = {
        center: new google.maps.LatLng(-54.798112, -68.303375),
        zoom: 11,
        mapTypeId: google.maps.MapTypeId.SATELLITE
    };

    $scope.myMarkers = [];


    $scope.addMarker = function ($event, $params) {
        $scope.myMarkers.push(new google.maps.Markers({
            map: $scope.myMap,
            position: $params.latLng
        }));
    };

    $scope.markerClicked = function(m) {
        window.alert("clicked");
    };


}]);

Don't know what I've did but I've installed with bower and know it works perfectly. :)