Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nlaplante committed Feb 21, 2013
2 parents cde5f2d + c2d800d commit 025dbb7
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/angular-google-maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,17 @@
*/
googleMapsModule.directive("googleMap", ["$log", "$timeout", "$filter", function ($log, $timeout,
$filter) {

var controller = function ($scope, $element) {

var _m = $scope.map;

self.addInfoWindow = function (lat, lng, content) {
_m.addInfoWindow(lat, lng, content);
};
};

controller.$inject = ['$scope', '$element'];

return {
restrict: "EC",
Expand All @@ -309,14 +320,7 @@
refresh: "&refresh", // optional
windows: "=windows" // optional"
},
controller: function ($scope, $element) {

var _m = $scope.map;

self.addInfoWindow = function (lat, lng, content) {
_m.addInfoWindow(lat, lng, content);
};
},
controller: controller,
link: function (scope, element, attrs, ctrl) {

// Center property must be specified and provide lat &
Expand Down Expand Up @@ -503,4 +507,4 @@
}
};
}]);
}());
}());

0 comments on commit 025dbb7

Please sign in to comment.