Skip to content

Commit

Permalink
fix(markerCompilation): use specified scope to listen to includeConte…
Browse files Browse the repository at this point in the history
…ntLoaded
  • Loading branch information
davidovich committed Jan 14, 2015
1 parent 1c6d175 commit 2d93794
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
8 changes: 3 additions & 5 deletions dist/angular-leaflet-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -3191,11 +3191,9 @@ angular.module("leaflet-directive").factory('leafletMarkersHelpers', ["$rootScop
$compile(popup._contentNode)(markerScope);
//in case of an ng-include, we need to update the content after template load
if (isDefined(popup._contentNode) && popup._contentNode.innerHTML.indexOf("ngInclude") > -1) {
var unregister = $rootScope.$on('$includeContentLoaded', function(event, src) {
if (popup.getContent().indexOf(src) > -1) {
updatePopup(popup);
unregister();
}
var unregister = markerScope.$on('$includeContentLoaded', function() {
updatePopup(popup);
unregister();
});
}
else {
Expand Down
Loading

0 comments on commit 2d93794

Please sign in to comment.