var ep = jsPlumb.addEndpoint("el", {
overlays:[ ["Label", {label:"FOO", id:"labelId" } ]]
});
then you can retrieve it with
var overlay = ep.getOverlay("labelId");
Remember that getOverlay returns the Overlay object and not the text
of the label; you would need to do this to get the text:
overlay.getLabel();
The getLabel method works only if you used the "label" parameter on
the Endpoint:
var ep = jsPlumb.addEndpoint("el", {
label:"FOO"
});
console.log(ep.getLabel()); // prints "FOO"
This mechanism is just a shortcut mechanism because label overlays are
quite common. Behind the scenes it's treated the same way as any
other overlay - jsPlumb uses this id:
var _internalLabelOverlayId = "__label";
...meaning you can of course retrieve a label set with the "label"
parameter like this:
endpoint.getOverlay("__label");
if you really wanted to. for some reason.
Connection has an 'endpoints' array.
connection.endpoints[0] - source
connection.endpoints[1] - target
I really should document this. I will do that for the 1.3.7 release.