From 806a865312c629a57d2bb84923a35ba6bf581686 Mon Sep 17 00:00:00 2001 From: "runxc1(Bret Ferrier)" Date: Wed, 19 Jun 2013 11:00:11 -0500 Subject: [PATCH] Fix multiple compilations from duplicating items in ng-repeat --- ui-map.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui-map.js b/ui-map.js index 33e377d..d71ab67 100644 --- a/ui-map.js +++ b/ui-map.js @@ -48,7 +48,7 @@ var infoWindowEvents = 'closeclick content_change domready ' + 'position_changed zindex_changed'; var options = uiMapInfoWindowConfig || {}; - + var compiled = false; return { link: function (scope, elm, attrs) { var opts = angular.extend({}, options, scope.$eval(attrs.uiOptions)); @@ -72,7 +72,10 @@ //Decorate infoWindow.open to $compile contents before opening var _open = infoWindow.open; infoWindow.open = function open(a1, a2, a3, a4, a5, a6) { - $compile(elm.contents())(scope); + if(!compiled){ + $compile(elm.contents())(scope); + compiled = true; + } _open.call(infoWindow, a1, a2, a3, a4, a5, a6); }; }