You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.
I'm trying to make my marker popups clickable. When I use html in the marker popup the html is rendered correctly but ng-click doesn't work. Here's what I have.
I'll check out the links and thanks for answering both of my last two posts!
Am I approaching this problem incorrectly? All I want to do is to make the marker's label clickable. Seems like something that other people would want too, right?
In case someone's looking for a solution to this issue:
// Here we are manually creating DOM that is not compiled by AngularJSvartitle='<span><a ng-click="hello()">'+Hello,World!+'</a> - <b>item1</b><br />item2</span>';// Compile title DOM into a link functionvarlinkFn=$compile(angular.element(title));// Return a jQuery DOM tree fully controlled by AngularJS so that ng directives will workvarpopup=linkFn(scope);varmark=L.marker(newL.LatLng(item.lat,item.lng));// We can only display a DOM node (bug with leaflet?) so this is why we use <span>...</span> as a parent nodemark.bindPopup(popup[0]);
...
scope.hello=function(){alert('Hello, World!');};
From @wootwoot1234 on May 25, 2014 1:37
I'm trying to make my marker popups clickable. When I use html in the marker popup the html is rendered correctly but ng-click doesn't work. Here's what I have.
Anyone know what I'm doing wrong or know how to call a function when the marker popup is clicked?
Copied from original issue: tombatossals/angular-leaflet-directive#372
The text was updated successfully, but these errors were encountered: