Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Fix multiple compilations from duplicating items in ng-repeat #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ui-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
};
}
Expand Down