How to add a listener on new Link created.
this.engine = new DiagramEngine();
this.engine.registerNodeFactory(new DefaultNodeFactory());
this.engine.registerLinkFactory(new DefaultLinkFactory());
this.engine.getDiagramModel().addListener({
nodesUpdated: function(e){
// Do something here
// alert("dd");
},
zoomUpdated: function(e){
// Do something here
//alert("Zoom");
},
linksUpdated: function(event){
console.log("events done:")
//// Want an on new link event
}
});
I tried this code but it's not working
Works on my side when I add the event to the DiagramModel
model.registerListener({
eventDidFire: action('model eventDidFire')
});
@dylanvorster My code is working fine. But, I don't know how to detect new Link created.
linksUpdated: function(event){
console.log("events done:") // all events are fired here , but I want specific event with their props.
//// Want an on new link event
}
@naveenraj006 could you solve your problem?
I have the same problem.