Hi, I am using the following code :
var g$ = go.GraphObject.make;
var diagram = g$(go.Diagram, 'myDiagram', {
nodeTemplateMap : diagramService.getNodeTemplateMap(),
linkTemplate : diagramService.getLinkTemplate(),
model : g$(go.GraphLinksModel, {
linkFromPortIdProperty : "fromPort",
linkToPortIdProperty : "toPort"
}),
initialContentAlignment : go.Spot.Center,
allowDrop : true,
});
diagram.model.addChangedListener(function(e) {
if (e.isTransactionFinished) {
var tx = e.object;
console.log(tx);
if (tx instanceof go.Transaction && console) {
console.log(tx.toString());
tx.changes.each(function(c) {
if (c.model) console.log(" " + c.toString());
});
}
)}
The issue is that console.log(tx) is always showing null, i.e, I am not able to get the Transaction from the ChangesEvent