Adding ng-class and ng-click to the DOM in a Leaflet popup
586 views
Skip to first unread message
Ashley
unread,
Jul 18, 2013, 11:45:34 PM7/18/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
I'm using Angular.JS and Leaflet.JS for a map in my location that has
map markers with popups binded to them. I need to use a span with an icon that you can click to call a function and with ng-class to change the class so I tried to add that to the DOM within the popup but it's not working. Unfortunately my app is big and not open source so I can't share the whole code but I put down the relevant code here: Plunker.
With that code, in the popup the div_popup ng-class/click just shows up as "[object Object]". I tried making a directive but I couldn't figure out how to call it from the controller and I was confused how to do it without using the view at all (the map, markers and popups are generated within my controller). Would anyone know what I'm doing wrong or what's the best way to accomplish this? Any kind of help or direction to look in would be much appreciated as I've been working on this for days with no success.
Pawel Kozlowski
unread,
Jul 20, 2013, 7:44:19 AM7/20/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
Hi!
The whole point of providing a plunker is to have life code that
people can debug. Just dumping a script fragment is no use, really...
Try to provide a running plunk that illustrates the essence of your
problem. This way people will be able to help.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
Okay, I built a simple JSFiddle (that Plunker template is not working) that demonstrates something similar to what I'm trying to do. It's here: http://jsfiddle.net/HB7LU/43/. In this case, the popup isn't showing up and when I click it, I get the error: TypeError: Value does not implement interface Node. When I remove the compile, I get the popup but nothing happens on clicking it. Any ideas on how I can get this to work?