I'm stuck at how to create a dom element in angular and pass it to jsPlumb which I am using to draw charts.
I create connections between nodes using jsPlumb and need to create an overlay on these connections. The offical jsPlumb documentation asks me to do something like this -
["Custom", {
create:function(component) {
return $("<select id='myDropDown'><option value='foo'>foo</option><option value='bar'>bar</option></select>");
},
location:0.5,
id:"customOverlay"
}]
In this line -
return $("<select id='myDropDown'><option value='foo'>foo</option><option value='bar'>bar</option></select>");
the example creates an element using jQuery and passes it to jsPlumb. However, in my application I don't use jQuery. Is there an angular way to do this without using jQuery?
Also, instead of passing an element, if I wanted to pass a component like below, how do I do it?
return $("<custom-overlay></custom-overlay>");
I considered using a ViewContainerRef. However, that requires an element which will be the anchor the dynamic components will be added. In this case the "anchor" is a connection line which can be dynamically created.
Is there anyway I can accomplish this without using jQuery? Any help is appreciated.